Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage text is not shown when usage is incorrect #202

Closed
p-mongo opened this issue May 30, 2020 · 5 comments · Fixed by #527
Closed

Usage text is not shown when usage is incorrect #202

p-mongo opened this issue May 30, 2020 · 5 comments · Fixed by #527
Labels
enhancement New feature or request

Comments

@p-mongo
Copy link
Contributor

p-mongo commented May 30, 2020

Now on master, I get:

carbon% mongocli iam project  create     
Error: accepts 1 arg(s), received 0

Since the usage was not correct, I would like mongocli to tell me what the correct usage is.

@gssbzn gssbzn added the enhancement New feature or request label Jun 8, 2020
@gssbzn
Copy link
Collaborator

gssbzn commented Jun 8, 2020

this relates to #198, sadly our current CLI framework is either always or never on usage, we do plan to do some significant improvements on usability next and we are already talking about improving some of our error messages

@p-mongo
Copy link
Contributor Author

p-mongo commented Jun 8, 2020

What would also be helpful is for (at least common) command line options to be accepted/ignored such that the following usage is possible:

# works
mongocli atlas  --projectId X clusters list

# fails
mongocli atlas  --projectId X 

# still fails
mongocli atlas  --projectId X  help

If I am working within a project, I would like to setup e.g. an alias like this:

alias m='mongocli atlas  --projectId X'

... and then be able to explore and receive help for commands without having to retype project id argument.

@gssbzn
Copy link
Collaborator

gssbzn commented Jun 8, 2020

@p-mongo for that project id usage you can do mongocli config set projecy_id (ID) and it should be set at the profile level so you don't have to do -- project again, and if you do - - project with a different ID from the profile it should take precedence

@gssbzn
Copy link
Collaborator

gssbzn commented Aug 7, 2020

Circling back on usage, we are waiting on spf13/cobra#842 to be merge and release so we can take advantage of it in our own case

@gssbzn
Copy link
Collaborator

gssbzn commented Nov 23, 2020

@p-mongo we have made an internal change as cobra is taking their time to address this, if you can test the latest master and let us know what you think we'd really appreciate it.

If not we're planning a release this week that should include this along with other improvements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants