summaryrefslogtreecommitdiff
path: root/swiftclient/shell.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-12-13 23:00:01 +0000
committerGerrit Code Review <review@openstack.org>2016-12-13 23:00:01 +0000
commit39a0eda48666e88fea3ba2109773dbadaa2d5474 (patch)
tree69695727cfdcdd65088cd185f28c3a2b37d3c761 /swiftclient/shell.py
parente3d6c34c982091882a5578ab2bdaf6da00eae4d6 (diff)
parent41666d60c88e4b70bceb7898459a93e6cf389382 (diff)
downloadpython-swiftclient-39a0eda48666e88fea3ba2109773dbadaa2d5474.tar.gz
Merge "modify 'swift <sub_command> —help' display"
Diffstat (limited to 'swiftclient/shell.py')
-rwxr-xr-xswiftclient/shell.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/swiftclient/shell.py b/swiftclient/shell.py
index 9fd7aac..e6075c7 100755
--- a/swiftclient/shell.py
+++ b/swiftclient/shell.py
@@ -884,7 +884,8 @@ st_upload_options = '''[--changed] [--skip-identical] [--segment-size <size>]
<container> <file_or_directory> [<file_or_directory>] [...]
'''
-st_upload_help = ''' Uploads specified files and directories to the given container.
+st_upload_help = '''
+Uploads specified files and directories to the given container.
Positional arguments:
<container> Name of container to upload to.
@@ -1121,7 +1122,8 @@ def st_upload(parser, args, output_manager):
output_manager.error(e.value)
-st_capabilities_options = "[--json] [<proxy_url>]"
+st_capabilities_options = '''[--json] [<proxy_url>]
+'''
st_info_options = st_capabilities_options
st_capabilities_help = '''
Retrieve capability of the proxy.
@@ -1221,7 +1223,8 @@ def st_auth(parser, args, thread_manager):
st_tempurl_options = '''[--absolute]
- <method> <seconds> <path> <key>'''
+ <method> <seconds> <path> <key>
+'''
st_tempurl_help = '''
@@ -1329,9 +1332,12 @@ def parse_args(parser, args, enforce_requires=True):
logging.basicConfig(level=logging.INFO)
if args and options.get('help'):
- _help = globals().get('st_%s_help' % args[0],
- "no help for %s" % args[0])
- print(_help)
+ _help = globals().get('st_%s_help' % args[0])
+ _options = globals().get('st_%s_options' % args[0], "\n")
+ if _help:
+ print("Usage: %s %s %s\n%s" % (BASENAME, args[0], _options, _help))
+ else:
+ print("no such command: %s" % args[0])
exit()
# Short circuit for tempurl, which doesn't need auth