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

`diesel database --help` inconsistent with completion output #1593

Closed
taktoa opened this Issue Mar 12, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@taktoa

taktoa commented Mar 12, 2018

Steps to reproduce:

  • Run cargo install diesel_cli.
  • Run diesel bash-completion > diesel-completions.bash; source diesel-completions.bash in Bash or ZSH.
  • Run diesel database --help. The output lists three subcommands: help, reset, and setup.
  • Type diesel database <TAB>. The completion menu gives four subcommands: help, reset, setup, and drop!
  • Running diesel database drop --help indicates that there is indeed such a command, but it is hidden!

I compiled diesel_cli version 1.1.0 under rustc 1.26.0-nightly (322d7f7b9 2018-02-25) by running cargo install diesel_cli. I am on NixOS, which is a complicating factor in a lot of cases, but I don't think that should affect this bug. If you can't reproduce it I can try to get more information on why it is happening.

I suggest that however it is you are generating the --help output for commands, it should be made automatically consistent with the completions.

@weiznich

This comment has been minimized.

Contributor

weiznich commented Mar 12, 2018

Our cli arguments are entirely handled by clap. Those crate generates help and bash completions for us.
diesel database drop is marked as hidden subcommand, therefore it is not shown in diesel database --help
I'm not sure if that's the intended of clap or if we should report it as bug there.

@taktoa

This comment has been minimized.

taktoa commented Mar 12, 2018

Ah, then there are two conceivable bugs here:

  1. Why is diesel database drop marked as hidden? If it's not intended to be used, why does it exist?
  2. Perhaps clap's bash completion generation should not emit hidden subcommands.
@sgrif

This comment has been minimized.

Member

sgrif commented Mar 14, 2018

git blame brings us to b7cad84 which gives context as to why it was hidden. That said, I don't know that it needs to be, and I'd be fine with a PR that un-hides it.

@sgrif sgrif closed this Mar 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment