summaryrefslogtreecommitdiffstats
path: root/subcmds/help.py
diff options
context:
space:
mode:
Diffstat (limited to 'subcmds/help.py')
-rw-r--r--subcmds/help.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/subcmds/help.py b/subcmds/help.py
index 36b3a7ae..5e24ed0b 100644
--- a/subcmds/help.py
+++ b/subcmds/help.py
@@ -19,6 +19,7 @@ import re
19import sys 19import sys
20from formatter import AbstractFormatter, DumbWriter 20from formatter import AbstractFormatter, DumbWriter
21 21
22from subcmds import all_commands
22from color import Coloring 23from color import Coloring
23from command import PagedCommand, MirrorSafeCommand, GitcAvailableCommand, GitcClientCommand 24from command import PagedCommand, MirrorSafeCommand, GitcAvailableCommand, GitcClientCommand
24import gitc_utils 25import gitc_utils
@@ -42,7 +43,7 @@ Displays detailed usage information about a command.
42 fmt = ' %%-%ds %%s' % maxlen 43 fmt = ' %%-%ds %%s' % maxlen
43 44
44 for name in commandNames: 45 for name in commandNames:
45 command = self.commands[name] 46 command = all_commands[name]
46 try: 47 try:
47 summary = command.helpSummary.strip() 48 summary = command.helpSummary.strip()
48 except AttributeError: 49 except AttributeError:
@@ -52,7 +53,7 @@ Displays detailed usage information about a command.
52 def _PrintAllCommands(self): 53 def _PrintAllCommands(self):
53 print('usage: repo COMMAND [ARGS]') 54 print('usage: repo COMMAND [ARGS]')
54 print('The complete list of recognized repo commands are:') 55 print('The complete list of recognized repo commands are:')
55 commandNames = list(sorted(self.commands)) 56 commandNames = list(sorted(all_commands))
56 self._PrintCommands(commandNames) 57 self._PrintCommands(commandNames)
57 print("See 'repo help <command>' for more information on a " 58 print("See 'repo help <command>' for more information on a "
58 'specific command.') 59 'specific command.')
@@ -73,7 +74,7 @@ Displays detailed usage information about a command.
73 return False 74 return False
74 75
75 commandNames = list(sorted([name 76 commandNames = list(sorted([name
76 for name, command in self.commands.items() 77 for name, command in all_commands.items()
77 if command.common and gitc_supported(command)])) 78 if command.common and gitc_supported(command)]))
78 self._PrintCommands(commandNames) 79 self._PrintCommands(commandNames)
79 80
@@ -132,8 +133,8 @@ Displays detailed usage information about a command.
132 out._PrintSection('Description', 'helpDescription') 133 out._PrintSection('Description', 'helpDescription')
133 134
134 def _PrintAllCommandHelp(self): 135 def _PrintAllCommandHelp(self):
135 for name in sorted(self.commands): 136 for name in sorted(all_commands):
136 cmd = self.commands[name] 137 cmd = all_commands[name]
137 cmd.manifest = self.manifest 138 cmd.manifest = self.manifest
138 self._PrintCommandHelp(cmd, header_prefix='[%s] ' % (name,)) 139 self._PrintCommandHelp(cmd, header_prefix='[%s] ' % (name,))
139 140
@@ -158,7 +159,7 @@ Displays detailed usage information about a command.
158 name = args[0] 159 name = args[0]
159 160
160 try: 161 try:
161 cmd = self.commands[name] 162 cmd = all_commands[name]
162 except KeyError: 163 except KeyError:
163 print("repo: '%s' is not a repo command." % name, file=sys.stderr) 164 print("repo: '%s' is not a repo command." % name, file=sys.stderr)
164 sys.exit(1) 165 sys.exit(1)