diff options
Diffstat (limited to 'subcmds')
-rw-r--r-- | subcmds/gitc_init.py | 3 | ||||
-rw-r--r-- | subcmds/help.py | 13 |
2 files changed, 13 insertions, 3 deletions
diff --git a/subcmds/gitc_init.py b/subcmds/gitc_init.py index c0568caa..e99affa5 100644 --- a/subcmds/gitc_init.py +++ b/subcmds/gitc_init.py | |||
@@ -18,10 +18,11 @@ import os | |||
18 | import sys | 18 | import sys |
19 | 19 | ||
20 | import gitc_utils | 20 | import gitc_utils |
21 | from command import RequiresGitcCommand | ||
21 | from subcmds import init | 22 | from subcmds import init |
22 | 23 | ||
23 | 24 | ||
24 | class GitcInit(init.Init): | 25 | class GitcInit(init.Init, RequiresGitcCommand): |
25 | common = True | 26 | common = True |
26 | helpSummary = "Initialize a GITC Client." | 27 | helpSummary = "Initialize a GITC Client." |
27 | helpUsage = """ | 28 | helpUsage = """ |
diff --git a/subcmds/help.py b/subcmds/help.py index 4aa3f863..ae5b8f08 100644 --- a/subcmds/help.py +++ b/subcmds/help.py | |||
@@ -19,7 +19,8 @@ import sys | |||
19 | from formatter import AbstractFormatter, DumbWriter | 19 | from formatter import AbstractFormatter, DumbWriter |
20 | 20 | ||
21 | from color import Coloring | 21 | from color import Coloring |
22 | from command import PagedCommand, MirrorSafeCommand | 22 | from command import PagedCommand, MirrorSafeCommand, RequiresGitcCommand |
23 | import gitc_utils | ||
23 | 24 | ||
24 | class Help(PagedCommand, MirrorSafeCommand): | 25 | class Help(PagedCommand, MirrorSafeCommand): |
25 | common = False | 26 | common = False |
@@ -54,9 +55,17 @@ Displays detailed usage information about a command. | |||
54 | def _PrintCommonCommands(self): | 55 | def _PrintCommonCommands(self): |
55 | print('usage: repo COMMAND [ARGS]') | 56 | print('usage: repo COMMAND [ARGS]') |
56 | print('The most commonly used repo commands are:') | 57 | print('The most commonly used repo commands are:') |
58 | |||
59 | def gitc_supported(cmd): | ||
60 | if not isinstance(cmd, RequiresGitcCommand): | ||
61 | return True | ||
62 | if gitc_utils.get_gitc_manifest_dir(): | ||
63 | return True | ||
64 | return False | ||
65 | |||
57 | commandNames = list(sorted([name | 66 | commandNames = list(sorted([name |
58 | for name, command in self.commands.items() | 67 | for name, command in self.commands.items() |
59 | if command.common])) | 68 | if command.common and gitc_supported(command)])) |
60 | 69 | ||
61 | maxlen = 0 | 70 | maxlen = 0 |
62 | for name in commandNames: | 71 | for name in commandNames: |