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
Update rsync completions #7763
Update rsync completions #7763
Conversation
complete -c rsync -l partial -d "Keep partially transferred files" | ||
complete -c rsync -l partial-dir -xa '(__fish_complete_directories)' -d "Put a partially transferred file into DIR" | ||
complete -c rsync -l delay-updates -d "Put all updated files into place at end" | ||
complete -c rsync -s m -l prune-empty-dirs -d "Prune empty directory chains from file-list" | ||
complete -c rsync -l numeric-ids -d "Don’t map uid/gid values by user/group name" | ||
complete -c rsync -l usermap -xa '(__fish_complete_users)' -d "Custom username mapping" | ||
complete -c rsync -l groupmap -xa '(__fish_complete_groups)' -d "Custom username mapping" | ||
complete -c rsync -l chown -xa '(__fish_complete_users;__fish_complete_groups)' -d "Combined username/groupname mapping" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A space after the ;
would be nice.
(also this does user:group, so maybe (__fish_complete_users):(__fish_complete_groups)
might be helpful, or more complicated logic to only complete the group after the user - see __fish_complete_user_at_hosts
for something similar)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(__fish_complete_users):(__fish_complete_groups)
unfortunately does not work in my testing, if I type :
and hit TAB it removes the whole option? Is there a any simple solution for the common user:group pattern?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aaaah, okay, both of these provide a description (after a tab character), so only the users part is actually used (because the rest is now after a tab).
Here's what the actual chown completions do:
complete -c chown -d Username -a "(__fish_print_users):"
complete -c chown -d Username -a "(string match -r -- '.*:' (commandline -ct))(__fish_complete_groups)"
You could probably make a helper function that
- if you don't have a ":" in the current token (
commandline -ct
) runs__fish_complete_users
- If you do, prints the current token plus everything in
__fish_complete_groups
(this would then also be useful in chown, and possibly elsewhere)
Or alternatively we can merge this as it stands and do that bit later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I think it is best to merge as it is and make such a helper function in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since :somegroup
is valid, that might need a separate entry (untested):
(echo; __fish_print_users):(__fish_complete_groups)
Merged, thanks! |
Description
This adds completions for the newer (and very useful)
info
+debug
flags, parsed from the help output:Also many other options that were missing. Based on the current rsync 3.2.3 man page.
TODOs: