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

--list flag #48

Closed
brandonkal opened this issue Mar 17, 2020 · 6 comments
Closed

--list flag #48

brandonkal opened this issue Mar 17, 2020 · 6 comments

Comments

@brandonkal
Copy link

It would be useful if mask --list printing a list of available commands.

@jacobdeichert
Copy link
Owner

mask --help does this... unless you mean you want an output that shows ALL commands in the tree?

@jacobdeichert jacobdeichert added the needs more info We need more details label Mar 17, 2020
@brandonkal
Copy link
Author

brandonkal commented Mar 17, 2020

Oops.

@brandonkal
Copy link
Author

@jakedeichert I've got things installed now and see that mask --help generates a traditional help screen.

The idea with --list is to return a newline separated list of available subcommands for things like bash completion and feeding into fzf.

As an example use case, mask could be well suited to produce an output selection similar to the pet exec experience.

@jacobdeichert
Copy link
Owner

jacobdeichert commented Mar 18, 2020

Regarding bash/zsh/fish completion, there was some discussion in #18. I'm waiting for clap v3 to release and will reconsider if shell completion generation should be built into mask.

Exposing a --list arg I'm unsure about. Just dumping all cmds as rows to stdout is not really following any standard format and though it may work for some tools, it won't be powerful enough for others. Especially if argument options aren't dumped with the cmds...

Instead of mask dumping an unorganized list of everything... it should be easy for people to parse the maskfile for cmd headings with a simple bash(insert lang here) script. It just needs to find lines with headings # and count the depth... very simple.

@jacobdeichert jacobdeichert removed the needs more info We need more details label Mar 18, 2020
@brandonkal
Copy link
Author

Yes. It is a bit annoying that clap sorts subcommands rather than allowing it to be the order in the markdown file.

@jacobdeichert
Copy link
Owner

Instead of mask dumping an unorganized list of everything... it should be easy for people to parse the maskfile for cmd headings with a simple bash(insert lang here) script. It just needs to find lines with headings # and count the depth... very simple.

Closing in favour of this recommendation I gave instead of building this into mask.

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

No branches or pull requests

2 participants