summaryrefslogtreecommitdiffstats
path: root/subcmds
diff options
context:
space:
mode:
Diffstat (limited to 'subcmds')
-rw-r--r--subcmds/gitc_init.py3
-rw-r--r--subcmds/help.py13
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
18import sys 18import sys
19 19
20import gitc_utils 20import gitc_utils
21from command import RequiresGitcCommand
21from subcmds import init 22from subcmds import init
22 23
23 24
24class GitcInit(init.Init): 25class 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
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: