cli icon indicating copy to clipboard operation
cli copied to clipboard

Reorder examples for brs and urs to improve comprehension

Open shalako opened this issue 9 years ago • 3 comments

A common source of confusion with the bind-route-service and unbind-route-service commands is that the DOMAIN, HOSTNAME, and PATH arguments are used to define the route. Though this is explained in the Options section, I have found that people immediately understand that the command is binding a route to a service instance as soon as I suggest reordering their command from cf brs example.com my-instance --hostname foo to cf brs example.com --hostname foo my-instance. This is because all the arguments necessary to define the route are grouped together. The CLI already supports this ordering, so I am suggesting we update the helpfile with this ordering.

Current

$ cf h brs
NAME:
   bind-route-service - Bind a service instance to an HTTP route

USAGE:
   cf bind-route-service DOMAIN SERVICE_INSTANCE [--hostname HOSTNAME] [--path PATH] [-c PARAMETERS_AS_JSON]

EXAMPLES:
   cf bind-route-service example.com myratelimiter --hostname myapp --path foo
   cf bind-route-service example.com myratelimiter -c file.json
   cf bind-route-service example.com myratelimiter -c '{"valid":"json"}'

$ cf h urs
NAME:
   unbind-route-service - Unbind a service instance from an HTTP route

USAGE:
   cf unbind-route-service DOMAIN SERVICE_INSTANCE [--hostname HOSTNAME] [--path PATH] [-f]

EXAMPLES:
   cf unbind-route-service example.com myratelimiter --hostname myapp --path foo

Desired

$ cf h brs
NAME:
   bind-route-service - Bind a service instance to an HTTP route

USAGE:
   cf bind-route-service DOMAIN [--hostname HOSTNAME] [--path PATH] SERVICE_INSTANCE [-c PARAMETERS_AS_JSON] 

EXAMPLES:
   cf bind-route-service example.com --hostname myapp --path foo myratelimiter
   cf bind-route-service example.com myratelimiter -c file.json
   cf bind-route-service example.com myratelimiter -c '{"valid":"json"}'

$ cf h urs
NAME:
   unbind-route-service - Unbind a service instance from an HTTP route

USAGE:
   cf unbind-route-service DOMAIN [--hostname HOSTNAME] [--path PATH] SERVICE_INSTANCE [-f]

EXAMPLES:
   cf unbind-route-service example.com --hostname myapp --path foo myratelimiter

CLI Version

cf version 6.28.0+9e024bdbd.2017-06-27

Platform & Shell Details

Mac OSX iTerm

shalako avatar Aug 09 '17 19:08 shalako

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/150111078

The labels on this github issue will be updated when the story is started.

cf-gitbot avatar Aug 09 '17 19:08 cf-gitbot

I can see how the suggestion would make it less confusing. @abbyachau : looking at other commands, it feels like we have a pattern of adding the required args first and then the options, this would break that. Is it a consistent pattern we want to stick to? Or can we do what makes sense on per command basis?

AartiKriplani avatar Dec 05 '18 11:12 AartiKriplani

Hey thanks @AartiKriplani it looks like @shalako received some solid user feedback about how we could reduce user confusion so it seemed sensible to make this change. Thanks for calling out though that we need to stay consistent, and it's reminded me to ensure we don't create inconsistency. I wouldn't want to comb through our current set of commands to make this change because our resources could be spent on delivering better user value (features, refactors). Please do not hesitate to reach out if you have any additional questions.

@shalako this change will appear in our next release. Thanks for reaching out to us.

abbyachau avatar Dec 06 '18 19:12 abbyachau