-
Notifications
You must be signed in to change notification settings - Fork 239
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
Tab-complete branch names for jj branch
subcommands
#1217
Comments
Here are my custom additions to the auto-generated completions (fish shell): complete -c jj -n "__fish_seen_subcommand_from branch; and __fish_seen_subcommand_from delete" -f -a "(jj branch list | cut --delimiter ':' --fields 1)"
complete -c jj -n "__fish_seen_subcommand_from branch; and __fish_seen_subcommand_from forget" -f -a "(jj branch list | cut --delimiter ':' --fields 1)"
complete -c jj -n "__fish_seen_subcommand_from branch; and __fish_seen_subcommand_from rename" -f -a "(jj branch list | cut --delimiter ':' --fields 1)"
complete -c jj -n "__fish_seen_subcommand_from branch; and __fish_seen_subcommand_from set" -f -a "(jj branch list | cut --delimiter ':' --fields 1)"
complete -c jj -n "__fish_seen_subcommand_from branch; and __fish_seen_subcommand_from track" -f -a "(jj branch list --all-remotes | cut --delimiter ':' --fields 1 | grep '\w@\w')"
complete -c jj -n "__fish_seen_subcommand_from branch; and __fish_seen_subcommand_from untrack" -f -a '(
for line in (jj branch list -a | cut --delimiter ":" --fields 1)
if echo $line | grep --quiet "^\S"
set --function __local_branch $line
continue
end
if [ $line = " @git" ]
continue
end
echo "$__local_branch$(string trim $line)"
end
set --erase __local_branch
)' As mentioned in this comment, adding that to the output of I would be happy to make that contribution, unless maintainers consider this an undue maintenance burden. In my opinion, if it does turn out to be a burden, it can just be deleted again. I don't think shell completions come with any expection of stability. |
That seems fine to me. Since #3651, |
Great! I didn't think of using templates, great idea. I'll see how simple I can make it and open a PR. |
Tab-completing branch names would be useful for all
branch
subcommands today execptlist
.e.g. I run into this on a regular basis:
or
It seems that Clap completion doesn't have support for this yet clap-rs/clap#1232.
The text was updated successfully, but these errors were encountered: