Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion ccmlib/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,15 @@ def usage(self):
:return Usage for the remote execution options
"""
# Retrieve the text for just the arguments
usage = self.parser.format_help().split("optional arguments:")[1]
formatted = self.parser.format_help()
try:
usage = formatted.split("optional arguments:")[1]
except IndexError:
try:
usage = formatted.split("options:")[1]
except IndexError:
# fallback to print the whole string
usage = formatted

# Remove any blank lines and return
return "Remote Options:" + os.linesep + \
Expand Down