Skip to content
This repository has been archived by the owner on Jul 12, 2018. It is now read-only.

validation of parameters #36

Open
haydonryan opened this issue Nov 10, 2016 · 3 comments
Open

validation of parameters #36

haydonryan opened this issue Nov 10, 2016 · 3 comments

Comments

@haydonryan
Copy link

It'd be really nice if the CLI performed validation on two use cases (fast feedback to user):

  1. if you specify a flag, but don't specify a parameter.
  2. if you repeat parameters (especially likely in creating a complex cloud config)
@haydonryan
Copy link
Author

for example due to stupidity I tried:

omg deploy-cloudconfig \

--bosh-url https://10.0.16.6 --bosh-port 25555
--bosh-user admin --bosh-pass cat director.pwd --ssl-ignore
aws-cloudconfigplugin-linux
--aws-region us-west-1
--aws-security-group
--bosh-az-name-1 public
--cidr-1 10.0.0.0/24
--gateway-1 10.0.0.1
--dns-1 10.0.0.2
--aws-az-name-1 us-west-1b
--aws-subnet-name-1 subnet-X
--bosh-reserve-range-1 "10.0.0.1-10.0.0.10"
--bosh-az-name-1 private
--cidr-1 10.0.16.0/20
--gateway-1 10.0.16.1
--dns-1 10.0.16.2
--aws-az-name-1 us-west-1b
--aws-subnet-name-1 subnet-X
--bosh-reserve-range-1 "10.0.16.1-10.0.16.10"
400 Bad Request error pushing cloud config to BOSH: {"code":40001,"description":"Required property 'networks' was not specified in object ({})"}

@zmb3
Copy link
Contributor

zmb3 commented Nov 10, 2016

These are limitations of the CLI library we use, which make it tricky for us to fix downstream. For example, in case 2 above, by the time the flags get to us the library has already picked the last use of a flag (we don't even see that it was supplied more than once). We should file issues upstream: https://github.com/urfave/cli

@haydonryan
Copy link
Author

Ok want me to do that?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants