[Openstack] Command Argument Naming Style

Hua ZZ Zhang zhuadl at cn.ibm.com
Thu Jul 19 09:36:24 UTC 2012


hi,

I found an interesting thing about the naming style of current command
arguments. it is a little difference across different components.
you can see nova/quantum/swift/keystone are using both dash '-' and
underline '_'. Only keystone is mixed with two style:  --xx_yyy_zzz
--xx-yyy-zzz
And glance use the --xx-yyy-zzz style which only contains dash '-'. IMO,
it's better to be consisitent in naming style for all core components,
including the usage text. secondly, avoid using same argument name with
different meanings or different argument name for the same meaning.
Thirdly, keep it simple as possible, don't use unnecessary symbols.

----------------------------------------------
project\style  --xx_yyy_zzz     --xx-yyy-zzz
----------------------------------------------
nova               Yes              No
quantum            Yes              No
swift              Yes              No
keystone           Yes              Yes
glance             No               Yes
----------------------------------------------


usage: nova [--debug] [--no_cache] [--timings] [--os_username OS_USERNAME]
            [--os_password OS_PASSWORD] [--os_tenant_name OS_TENANT_NAME]
            [--os_auth_url OS_AUTH_URL] [--os_region_name OS_REGION_NAME]
            [--service_type SERVICE_TYPE] [--service_name SERVICE_NAME]
            [--volume_service_name VOLUME_SERVICE_NAME]
            [--endpoint_type ENDPOINT_TYPE]
            [--os_compute_api_version OS_COMPUTE_API_VERSION]
            [--username USERNAME] [--region_name REGION_NAME]
            [--apikey APIKEY] [--projectid PROJECTID] [--url URL]
            [--bypass_url BYPASS_URL]
            <subcommand> ...

usage: quantum [--version] [-v] [-q] [-h] [--debug]
               [--os_auth_strategy <auth_strategy>] [--os_auth_url
<auth_url>]
               [--os_tenant_name <auth_tenant_name>]
               [--os_username <auth_username>] [--os_password
<auth_password>]
               [--os_region_name <auth_region_name>] [--os_token <token>]
               [--os_url <url>]
swift
Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -s, --snet            Use SERVICENET internal network
  -v, --verbose         Print more info
  -q, --quiet           Suppress status output
  -A AUTH, --auth=AUTH  URL for obtaining an auth token
  -V AUTH_VERSION, --auth-version=AUTH_VERSION
                        Specify a version for authentication(default: 1.0)
  -U USER, --user=USER  User name for obtaining an auth token
  -K KEY, --key=KEY     Key for obtaining an auth token
  --os_auth_url=OS_AUTH_URL
                        Openstack auth URL. Defaults to env[OS_AUTH_URL].
  --os_username=OS_USERNAME
                        Openstack username. Defaults to env[OS_USERNAME].
  --os_tenant_name=OS_TENANT_NAME
                        Openstack tenant name.Defaults to env
[OS_TENANT_NAME].
  --os_password=OS_PASSWORD
                        Openstack password. Defaults to env[OS_PASSWORD].

usage: keystone [--os-username <auth-user-name>]
                [--os-password <auth-password>]
                [--os-tenant-name <auth-tenant-name>]
                [--os-tenant-id <tenant-id>] [--os-auth-url <auth-url>]
                [--os-region-name <region-name>]
                [--os-identity-api-version <identity-api-version>]
                [--token <service-token>] [--endpoint <service-endpoint>]
                [--os_cacert <ca-certificate>] [--os_cert <certificate>]
                [--os_key <key>] [--username <auth-user-name>]
                [--password <auth-password>] [--tenant_name <tenant-name>]
                [--auth_url <auth-url>] [--region_name <region-name>]
                <subcommand> ...

usage: glance [--os-username OS_USERNAME] [--os-password OS_PASSWORD]
              [--os-tenant-id OS_TENANT_ID] [--os-tenant-name
OS_TENANT_NAME]
              [--os-auth-url OS_AUTH_URL] [--os-region-name OS_REGION_NAME]
              [--os-auth-token OS_AUTH_TOKEN] [--os-image-url OS_IMAGE_URL]
              [--os-image-api-version OS_IMAGE_API_VERSION]
              [--os-service-type OS_SERVICE_TYPE]
              <subcommand> ...

Best Regards,

                                                                             
 Edward Zhang(张华)                    地址:北京市海淀区东北旺西路8号 中关村 
 Staff Software Engineer               软件园28号楼 环宇大厦3层 邮编:100193 
 Travel&Transportation Standards       Address: 3F Ring, Building 28         
 Emerging Technology Institute(ETI)    Zhongguancun Software Park, 8         
 IBM China Software Development Lab    Dongbeiwang West Road, Haidian        
 e-mail: zhuadl at cn.ibm.com             District, Beijing, P.R.C.100193       
 Notes ID: Hua ZZ Zhang/China/IBM                                            
 Tel: 86-10-82450483                                                         
                                                                             
                                                                             
                                                                             
                                                                             
                                                                             
                                                                             
                                                                             

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20120719/d10951be/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2A873450.gif
Type: image/gif
Size: 1279 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20120719/d10951be/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20120719/d10951be/attachment-0001.gif>


More information about the Openstack mailing list