diff options
author | Mike Frysinger <vapier@google.com> | 2021-02-16 01:43:31 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2021-02-22 22:51:07 +0000 |
commit | 6a2400a4d097b6e510dc9b8ec06283517b9ca3ad (patch) | |
tree | 55ad212633615a1d0ea1bb3f5c294f495bd223a7 /subcmds/status.py | |
parent | c5bbea8db364b88558acc434be16ec82c04737e5 (diff) | |
download | git-repo-6a2400a4d097b6e510dc9b8ec06283517b9ca3ad.tar.gz |
command: unify --job option & default values
Extend the Command class to support adding the --jobs option to the
parser if the command declares it supports running in parallel. Also
pull the default value used for the number of local jobs into the
command module so local commands can share it.
Change-Id: I22b0f8d2cf69875013cec657b8e6c4385549ccac
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/297024
Tested-by: Mike Frysinger <vapier@google.com>
Reviewed-by: Chris Mcdonald <cjmcdonald@google.com>
Diffstat (limited to 'subcmds/status.py')
-rw-r--r-- | subcmds/status.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/subcmds/status.py b/subcmds/status.py index e293d75c..f0f2e034 100644 --- a/subcmds/status.py +++ b/subcmds/status.py | |||
@@ -17,7 +17,7 @@ import glob | |||
17 | import multiprocessing | 17 | import multiprocessing |
18 | import os | 18 | import os |
19 | 19 | ||
20 | from command import PagedCommand | 20 | from command import DEFAULT_LOCAL_JOBS, PagedCommand |
21 | 21 | ||
22 | from color import Coloring | 22 | from color import Coloring |
23 | import platform_utils | 23 | import platform_utils |
@@ -76,11 +76,10 @@ the following meanings: | |||
76 | d: deleted ( in index, not in work tree ) | 76 | d: deleted ( in index, not in work tree ) |
77 | 77 | ||
78 | """ | 78 | """ |
79 | PARALLEL_JOBS = DEFAULT_LOCAL_JOBS | ||
79 | 80 | ||
80 | def _Options(self, p): | 81 | def _Options(self, p): |
81 | p.add_option('-j', '--jobs', | 82 | super()._Options(p) |
82 | dest='jobs', action='store', type='int', default=2, | ||
83 | help="number of projects to check simultaneously") | ||
84 | p.add_option('-o', '--orphans', | 83 | p.add_option('-o', '--orphans', |
85 | dest='orphans', action='store_true', | 84 | dest='orphans', action='store_true', |
86 | help="include objects in working directory outside of repo projects") | 85 | help="include objects in working directory outside of repo projects") |