ansibleplaybookbundle / ansible-playbook-bundle

THIS REPO IS MIGRATING: https://github.com/automationbroker/apb
GNU General Public License v2.0
140 stars 70 forks source link

Bug 1581651 - disable argparse abbreviations #296

Closed jmrodri closed 6 years ago

jmrodri commented 6 years ago

Override the ArgumentParser so we could disable the argument abbreviations.

jmrodri commented 6 years ago
$ apb relist --help
usage: apb relist [-h] [--broker-name BROKER_NAME] [--secure] [--ca-path CERT]
                  [--username BASIC_AUTH_USERNAME]
                  [--password BASIC_AUTH_PASSWORD]

optional arguments:
  -h, --help            show this help message and exit
  --broker-name BROKER_NAME
                        Name of the ServiceBroker k8s resource
  --secure              Verify SSL connection to Ansible Service Broker
  --ca-path CERT        CA cert to use for verifying SSL connection to Ansible
                        Service Broker
  --username BASIC_AUTH_USERNAME, -u BASIC_AUTH_USERNAME
                        Specify the basic auth username to be used
  --password BASIC_AUTH_PASSWORD, -p BASIC_AUTH_PASSWORD
                        Specify the basic auth password to be used
jmrodri commented 6 years ago

passing in an invalid option now correctly prints out the usage

$ apb relist --broker  asb-1338-ansible-service-broker.172.17.0.1.nip.io
usage: apb [-h] [--debug] [--project BASE_PATH] [--token AUTH_TOKEN]
           {relist,run,help,test,refresh,prepare,setup,bootstrap,list,remove,init,version,build,push,serviceinstance}
           ...
apb: error: unrecognized arguments: --broker asb-1338-ansible-service-broker.172.17.0.1.nip.io
jmrodri commented 6 years ago
$ apb relist 
Successfully relisted the Service Catalog