add shell completion for flamegraph#153
Merged
djc merged 1 commit intoflamegraph-rs:mainfrom Sep 6, 2021
Merged
Conversation
5bd2989 to
d8ee9a7
Compare
Contributor
|
I added some conflict handling in f5a1b9c. Doesn't need to be with all the options, just the ones that allow specifying a workload. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
About
This PR adds shell auto-completion support for the
flamegraphbinary.flamegraph --completions <shell>prints the completion script for the given shell to stdout. Currently supported shells arebash,fish,powershellandelvish(andzshbut it does not work).Internally,
claps completion generation is used.Known issues/limitations:
Completions must be installed manually.
cargo installdoes not support installing extra files right now ifclaps documentation is to be believed. This means we cannot place a completion script into a completion directory for the user on install and would have to provide a distribution package (deb,rpm, ...) for this.No completions for
cargo flamegraph.As far as I know, there is no official way to get completions for custom cargo subcommands. I tried getting it to work anyway without success. The issue is that you have to provide a binary name for which the completions will be generated.
cargo-flamegraphsort of works for this if you invoke it directly but does not work at all when usingcargo flamegraphas a custom subcommand.cargoas the binary name seems to be working great forcargo flamegraph. However it overrides existing completions so that you lose completions forcargo buildetc.Invoking
flamegraph --completions zshpanics.I didn't look into this.
clappanics: