diff options
author | Dean Troyer <dtroyer@gmail.com> | 2012-08-23 14:09:56 -0500 |
---|---|---|
committer | Dean Troyer <dtroyer@gmail.com> | 2012-08-23 14:16:50 -0500 |
commit | 55f0886066e9afbd459b1e73b394f8674fd66924 (patch) | |
tree | 9ed3c35efa799a9377ce183df46733b550cf9af0 /bin | |
parent | 46aad0e8fb474dae3787c8542e9f1bea00441510 (diff) | |
download | python-swiftclient-55f0886066e9afbd459b1e73b394f8674fd66924.tar.gz |
Change '_' to '-' in options
This changes every command-line option with a '_' in its name
and changes them to '-'. The old option names are maintained
for backward compatibility but are no longer in the help text.
BP command-options
Change-Id: I79b3c03f59ce8e253aa0dcbf0c2ed5a56d71cd0c
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/swift | 48 |
1 files changed, 35 insertions, 13 deletions
@@ -18,7 +18,7 @@ import socket from errno import EEXIST, ENOENT from hashlib import md5 -from optparse import OptionParser +from optparse import OptionParser, SUPPRESS_HELP from os import environ, listdir, makedirs, utime, _exit as os_exit from os.path import basename, dirname, getmtime, getsize, isdir, join from Queue import Empty, Queue @@ -1032,8 +1032,8 @@ Auth version 1.0 requires ST_AUTH, ST_USER, and ST_KEY environment variables to be set or overridden with -A, -U, or -K. Auth version 2.0 requires OS_AUTH_URL, OS_USERNAME, OS_PASSWORD, and -OS_TENANT_NAME OS_TENANT_ID to be set or overridden with --os-auth_url, ---os_username, --os_password, --os_tenant_name or os_tenant_id.'''.strip('\n')) +OS_TENANT_NAME OS_TENANT_ID to be set or overridden with --os-auth-url, +--os-username, --os-password, --os-tenant-name or os-tenant-id.'''.strip('\n')) return options, args @@ -1073,36 +1073,58 @@ Example: parser.add_option('-K', '--key', dest='key', default=environ.get('ST_KEY'), help='Key for obtaining an auth token') - parser.add_option('--os_username', dest='os_username', + parser.add_option('--os-username', + metavar='<auth-user-name>', default=environ.get('OS_USERNAME'), help='Openstack username. Defaults to env[OS_USERNAME].') - parser.add_option('--os_password', dest='os_password', + parser.add_option('--os_username', + help=SUPPRESS_HELP) + parser.add_option('--os-password', + metavar='<auth-password>', default=environ.get('OS_PASSWORD'), help='Openstack password. Defaults to env[OS_PASSWORD].') - parser.add_option('--os_tenant_id', + parser.add_option('--os_password', + help=SUPPRESS_HELP) + parser.add_option('--os-tenant-id', + metavar='<auth-tenant-id>', default=environ.get('OS_TENANT_ID'), help='OpenStack tenant ID.' \ 'Defaults to env[OS_TENANT_ID]') - parser.add_option('--os_tenant_name', dest='os_tenant_name', + parser.add_option('--os_tenant_id', + help=SUPPRESS_HELP) + parser.add_option('--os-tenant-name', + metavar='<auth-tenant-name>', default=environ.get('OS_TENANT_NAME'), help='Openstack tenant name.' \ 'Defaults to env[OS_TENANT_NAME].') - parser.add_option('--os_auth_url', dest='os_auth_url', + parser.add_option('--os_tenant_name', + help=SUPPRESS_HELP) + parser.add_option('--os-auth-url', + metavar='<auth-url>', default=environ.get('OS_AUTH_URL'), help='Openstack auth URL. Defaults to env[OS_AUTH_URL].') - parser.add_option('--os_auth_token', dest='os_auth_token', + parser.add_option('--os_auth_url', + help=SUPPRESS_HELP) + parser.add_option('--os-auth-token', + metavar='<auth-token>', default=environ.get('OS_AUTH_TOKEN'), help='Openstack token. Defaults to env[OS_AUTH_TOKEN]') - parser.add_option('--os_storage_url', - dest='os_storage_url', + parser.add_option('--os_auth_token', + help=SUPPRESS_HELP) + parser.add_option('--os-storage-url', + metavar='<storage-url>', default=environ.get('OS_STORAGE_URL'), help='Openstack storage URL.' \ 'Defaults to env[OS_STORAGE_URL]') - parser.add_option('--os_service_type', - dest='os_service_type', + parser.add_option('--os_storage_url', + help=SUPPRESS_HELP) + parser.add_option('--os-service-type', + metavar='<service-type>', default=environ.get('OS_SERVICE_TYPE'), help='Openstack Service type.' \ 'Defaults to env[OS_SERVICE_TYPE]') + parser.add_option('--os_service_type', + help=SUPPRESS_HELP) parser.disable_interspersed_args() (options, args) = parse_args(parser, argv[1:], enforce_requires=False) parser.enable_interspersed_args() |