diff options
Diffstat (limited to 'subcmds/help.py')
-rw-r--r-- | subcmds/help.py | 13 |
1 files changed, 11 insertions, 2 deletions
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: |