summaryrefslogtreecommitdiffstats
path: root/subcmds/help.py
diff options
context:
space:
mode:
Diffstat (limited to 'subcmds/help.py')
-rw-r--r--subcmds/help.py33
1 files changed, 14 insertions, 19 deletions
diff --git a/subcmds/help.py b/subcmds/help.py
index 375d04d2..57fb3cc2 100644
--- a/subcmds/help.py
+++ b/subcmds/help.py
@@ -13,6 +13,7 @@
13# See the License for the specific language governing permissions and 13# See the License for the specific language governing permissions and
14# limitations under the License. 14# limitations under the License.
15 15
16from __future__ import print_function
16import re 17import re
17import sys 18import sys
18from formatter import AbstractFormatter, DumbWriter 19from formatter import AbstractFormatter, DumbWriter
@@ -31,10 +32,8 @@ Displays detailed usage information about a command.
31""" 32"""
32 33
33 def _PrintAllCommands(self): 34 def _PrintAllCommands(self):
34 print 'usage: repo COMMAND [ARGS]' 35 print('usage: repo COMMAND [ARGS]')
35 print """ 36 print('The complete list of recognized repo commands are:')
36The complete list of recognized repo commands are:
37"""
38 commandNames = self.commands.keys() 37 commandNames = self.commands.keys()
39 commandNames.sort() 38 commandNames.sort()
40 39
@@ -49,17 +48,14 @@ The complete list of recognized repo commands are:
49 summary = command.helpSummary.strip() 48 summary = command.helpSummary.strip()
50 except AttributeError: 49 except AttributeError:
51 summary = '' 50 summary = ''
52 print fmt % (name, summary) 51 print(fmt % (name, summary))
53 print """ 52 print("See 'repo help <command>' for more information on a"
54See 'repo help <command>' for more information on a specific command. 53 'specific command.')
55"""
56 54
57 def _PrintCommonCommands(self): 55 def _PrintCommonCommands(self):
58 print 'usage: repo COMMAND [ARGS]' 56 print('usage: repo COMMAND [ARGS]')
59 print """ 57 print('The most commonly used repo commands are:')
60The most commonly used repo commands are: 58 commandNames = [name
61"""
62 commandNames = [name
63 for name in self.commands.keys() 59 for name in self.commands.keys()
64 if self.commands[name].common] 60 if self.commands[name].common]
65 commandNames.sort() 61 commandNames.sort()
@@ -75,11 +71,10 @@ The most commonly used repo commands are:
75 summary = command.helpSummary.strip() 71 summary = command.helpSummary.strip()
76 except AttributeError: 72 except AttributeError:
77 summary = '' 73 summary = ''
78 print fmt % (name, summary) 74 print(fmt % (name, summary))
79 print """ 75 print(
80See 'repo help <command>' for more information on a specific command. 76"See 'repo help <command>' for more information on a specific command.\n"
81See 'repo help --all' for a complete list of recognized commands. 77"See 'repo help --all' for a complete list of recognized commands.")
82"""
83 78
84 def _PrintCommandHelp(self, cmd): 79 def _PrintCommandHelp(self, cmd):
85 class _Out(Coloring): 80 class _Out(Coloring):
@@ -162,7 +157,7 @@ See 'repo help --all' for a complete list of recognized commands.
162 try: 157 try:
163 cmd = self.commands[name] 158 cmd = self.commands[name]
164 except KeyError: 159 except KeyError:
165 print >>sys.stderr, "repo: '%s' is not a repo command." % name 160 print("repo: '%s' is not a repo command." % name, file=sys.stderr)
166 sys.exit(1) 161 sys.exit(1)
167 162
168 cmd.manifest = self.manifest 163 cmd.manifest = self.manifest