Fix swiftclient help

Command help was wrong in some cases. While we're at it, add some
defaults to help and change some brackets to be consistent with
http://en.wikipedia.org/wiki/Command-line_interface#Command_description_syntax

Change-Id: I5d7b2a703294d97fc5e3de43b9ec375c3ea55a6e
This commit is contained in:
Christian Schwede 2014-02-07 11:39:24 +00:00
parent 0d3f4a0aa2
commit 545ea2e032
1 changed files with 20 additions and 16 deletions

View File

@ -86,9 +86,11 @@ Optional arguments:
--all Delete all containers and objects
--leave-segments Do not delete segments of manifest objects
--object-threads <threads>
Number of threads to use for deleting objects
Number of threads to use for deleting objects.
Default is 10
--container-threads <threads>
Number of threads to use for deleting containers
Number of threads to use for deleting containers.
Default is 10
'''.strip("\n")
@ -238,7 +240,7 @@ def st_delete(parser, args, thread_manager):
st_download_options = '''[--all] [--marker] [--prefix <prefix>]
[--output <out_file>] [--object-threads <threads>]
[--container-threads <threads>] [--no-download]
<container> <object>
<container> [object]
'''
st_download_help = '''
@ -247,7 +249,7 @@ Download objects from containers
Positional arguments:
<container> Name of container to download from. To download a
whole account, omit this and specify --all.
<object> Name of object to download. Specify multiple times
[object] Name of object to download. Specify multiple times
for multiple objects. Omit this to download all
objects from the container.
@ -261,9 +263,11 @@ Optional arguments:
<out_file>. Specifying "-" as <out_file> will
redirect to stdout
--object-threads <threads>
Number of threads to use for downloading objects
Number of threads to use for downloading objects.
Default is 10
--container-threads <threads>
Number of threads to use for deleting containers
Number of threads to use for downloading containers.
Default is 10
--no-download Perform download(s), but don't actually write anything
to disk
--header <header_name:header_value>
@ -294,7 +298,7 @@ def st_download(parser, args, thread_manager):
default=10, help='Number of threads to use for downloading objects')
parser.add_option(
'', '--container-threads', type=int, default=10,
help='Number of threads to use for listing containers')
help='Number of threads to use for downloading containers')
parser.add_option(
'', '--no-download', action='store_true',
default=False,
@ -478,8 +482,8 @@ def st_download(parser, args, thread_manager):
for obj in args[1:]:
object_queue.put((args[0], obj))
st_list_options = '''[--long] [--lh] [--totals]
[--container-threads <threads>]
st_list_options = '''[--long] [--lh] [--totals] [--prefix <prefix>]
[--delimiter <delimiter>]
'''
st_list_help = '''
Lists the containers for the account or the objects for a container
@ -490,7 +494,7 @@ Positional arguments:
Optional arguments:
--long Long listing format, similar to ls -l
--lh Report sizes in human readable format similar to ls -lh
--totals Used with -l or --ls, only report totals
--totals Used with -l or --lh, only report totals
--prefix Only list items beginning with the prefix
--delimiter Roll up items with the given delimiter. For containers
only. See OpenStack Swift API documentation for what
@ -507,7 +511,7 @@ def st_list(parser, args, thread_manager):
"similar to ls -lh switch, but -h taken", action='store_true',
default=False)
parser.add_option(
'-t', '--totals', dest='totals', help='used with -l or --ls, '
'-t', '--totals', dest='totals', help='used with -l or --lh, '
'only report totals',
action='store_true', default=False)
parser.add_option(
@ -598,15 +602,15 @@ def st_list(parser, args, thread_manager):
thread_manager.error('Container %r not found', args[0])
st_stat_options = '''[--lh]
<container> <object>
[container] [object]
'''
st_stat_help = '''
Displays information for the account, container, or object
Positional arguments:
<container> Name of container to stat from
<object> Name of object to stat. Specify multiple times
[container] Name of container to stat from
[object] Name of object to stat. Specify multiple times
for multiple objects
Optional arguments:
@ -655,7 +659,7 @@ def st_stat(parser, args, thread_manager):
st_post_options = '''[--read-acl <acl>] [--write-acl <acl>] [--sync-to]
[--sync-key <sync-key>] [--meta <name:value>]
[--header <header>]
<container> <object>
[container] [object]
'''
st_post_help = '''
@ -663,7 +667,7 @@ Updates meta information for the account, container, or object.
If the container is not found, it will be created automatically.
Positional arguments:
<container> Name of container to post to
[container] Name of container to post to
[object] Name of object to post. Specify multiple times
for multiple objects