summaryrefslogtreecommitdiffstats
path: root/pym/_emerge/help.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-07-29 12:05:43 +0000
committerZac Medico <zmedico@gentoo.org>2008-07-29 12:05:43 +0000
commitd85aa8088a5cd4bc27b7d2d568242e5c84a758a0 (patch)
tree9ae2c3668bd46ada351a358bab22b5a32a4aee94 /pym/_emerge/help.py
parent428efdb7ac7592f3e6f57bf390bc76ff9bb8c88f (diff)
downloadportage-d85aa8088a5cd4bc27b7d2d568242e5c84a758a0.tar.gz
portage-d85aa8088a5cd4bc27b7d2d568242e5c84a758a0.tar.bz2
portage-d85aa8088a5cd4bc27b7d2d568242e5c84a758a0.zip
Add support for the --jobs option to be specified without an
argument, and also support -j as a short option. Since optparse doesn't natively support options with non-required args, create an insert_optional_args() function that inserts the required argument into the args so that optparse is happy. The function inserts the string True as a substitute for the argument that is required. This string is later converted to the True constant when stored in the emerge opts dict (similar to how normal boolean options are stored). The PollScheduler and SequentialTaskQueue classes recognize the meaning of the True constant to mean unlimited concurrent jobs. svn path=/main/trunk/; revision=11261
Diffstat (limited to 'pym/_emerge/help.py')
-rw-r--r--pym/_emerge/help.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/pym/_emerge/help.py b/pym/_emerge/help.py
index b2c032b21..bb4077aa5 100644
--- a/pym/_emerge/help.py
+++ b/pym/_emerge/help.py
@@ -14,7 +14,7 @@ def shorthelp():
print " "+turquoise("emerge")+" < "+turquoise("--sync")+" | "+turquoise("--metadata")+" | "+turquoise("--info")+" >"
print " "+turquoise("emerge")+" "+turquoise("--resume")+" [ "+green("--pretend")+" | "+green("--ask")+" | "+green("--skipfirst")+" ]"
print " "+turquoise("emerge")+" "+turquoise("--help")+" [ "+green("system")+" | "+green("world")+" | "+green("--sync")+" ] "
- print bold("Options:")+" "+green("-")+"["+green("abBcCdDefgGhkKlnNoOpqPsStuvV")+"]"
+ print bold("Options:")+" "+green("-")+"["+green("abBcCdDefgGhjkKlnNoOpqPsStuvV")+"]"
print " [ " + green("--color")+" < " + turquoise("y") + " | "+ turquoise("n")+" > ] [ "+green("--columns")+" ]"
print " [ "+green("--complete-graph")+" ] [ "+green("--deep")+" ]"
print " [ "+green("--jobs") + " " + turquoise("JOBS")+" ] [ "+green("--keep-going")+" ] [ " + green("--load-average")+" " + turquoise("LOAD") + " ]"
@@ -305,9 +305,12 @@ def help(myaction,myopts,havecolor=1):
print " downloaded from the remote server without consulting packages"
print " existing in the packages directory."
print
- print " " + green("--jobs") + " " + turquoise("JOBS")
+ print " " + green("--jobs") + " " + turquoise("[JOBS]") + " ("+green("-j")+" short option)"
desc = "Specifies the number of packages " + \
- "to build simultaneously. Also see " + \
+ "to build simultaneously. If this option is " + \
+ "given without an argument, emerge will not " + \
+ "limit the number of jobs that " + \
+ "can run simultaneously. Also see " + \
"the related --load-average option."
for line in wrap(desc, desc_width):
print desc_indent + line