summaryrefslogtreecommitdiffstats
path: root/subcmds/help.py
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2015-08-31 15:45:06 -0700
committerDan Willemsen <dwillemsen@google.com>2015-09-01 12:23:56 -0700
commit9ff2ece6abc5d0d4a69c2f086209f107fd4f04be (patch)
tree1daabfe078e59b38ba0a1fdf9f6b0c83bcf7eba9 /subcmds/help.py
parent2487cb7b2c41506c8ef900dba735876b01c67eab (diff)
downloadgit-repo-9ff2ece6abc5d0d4a69c2f086209f107fd4f04be.tar.gz
gitc: Improve help visibilityv1.12.28
This improves the visiblity of gitc-init if we can get the gitc config, and hides it otherwise. Change-Id: I82830b0b07c311e8c74397ba79eb4c361f8b6fb5
Diffstat (limited to 'subcmds/help.py')
-rw-r--r--subcmds/help.py13
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
19from formatter import AbstractFormatter, DumbWriter 19from formatter import AbstractFormatter, DumbWriter
20 20
21from color import Coloring 21from color import Coloring
22from command import PagedCommand, MirrorSafeCommand 22from command import PagedCommand, MirrorSafeCommand, RequiresGitcCommand
23import gitc_utils
23 24
24class Help(PagedCommand, MirrorSafeCommand): 25class 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: