diff options
Diffstat (limited to 'subcmds/help.py')
| -rw-r--r-- | subcmds/help.py | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/subcmds/help.py b/subcmds/help.py index 375d04d2c..57fb3cc28 100644 --- a/subcmds/help.py +++ b/subcmds/help.py @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +from __future__ import print_function import re import sys from formatter import AbstractFormatter, DumbWriter @@ -31,10 +32,8 @@ Displays detailed usage information about a command. """ def _PrintAllCommands(self): - print 'usage: repo COMMAND [ARGS]' - print """ -The complete list of recognized repo commands are: -""" + print('usage: repo COMMAND [ARGS]') + print('The complete list of recognized repo commands are:') commandNames = self.commands.keys() commandNames.sort() @@ -49,17 +48,14 @@ The complete list of recognized repo commands are: summary = command.helpSummary.strip() except AttributeError: summary = '' - print fmt % (name, summary) - print """ -See 'repo help <command>' for more information on a specific command. -""" + print(fmt % (name, summary)) + print("See 'repo help <command>' for more information on a" + 'specific command.') def _PrintCommonCommands(self): - print 'usage: repo COMMAND [ARGS]' - print """ -The most commonly used repo commands are: -""" - commandNames = [name + print('usage: repo COMMAND [ARGS]') + print('The most commonly used repo commands are:') + commandNames = [name for name in self.commands.keys() if self.commands[name].common] commandNames.sort() @@ -75,11 +71,10 @@ The most commonly used repo commands are: summary = command.helpSummary.strip() except AttributeError: summary = '' - print fmt % (name, summary) - print """ -See 'repo help <command>' for more information on a specific command. -See 'repo help --all' for a complete list of recognized commands. -""" + print(fmt % (name, summary)) + print( +"See 'repo help <command>' for more information on a specific command.\n" +"See 'repo help --all' for a complete list of recognized commands.") def _PrintCommandHelp(self, cmd): class _Out(Coloring): @@ -162,7 +157,7 @@ See 'repo help --all' for a complete list of recognized commands. try: cmd = self.commands[name] except KeyError: - print >>sys.stderr, "repo: '%s' is not a repo command." % name + print("repo: '%s' is not a repo command." % name, file=sys.stderr) sys.exit(1) cmd.manifest = self.manifest |
