From 4095247debd2e2f726f811b9d2365f42e1f8a618 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sun, 20 Oct 2019 21:07:26 +0200 Subject: [PATCH] completions/git: some improvements --- share/completions/git.fish | 16 ++++++++-------- share/functions/__fish_any_arg_in.fish | 9 +++++++++ 2 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 share/functions/__fish_any_arg_in.fish diff --git a/share/completions/git.fish b/share/completions/git.fish index 79023c5b5..fccdd0ad9 100644 --- a/share/completions/git.fish +++ b/share/completions/git.fish @@ -729,14 +729,14 @@ complete -f -c git -l help -d 'Display the manual of a git command' complete -f -c git -n '__fish_git_needs_command' -l version -d 'Display version' complete -x -c git -n '__fish_git_needs_command' -s C -a '(__fish_complete_directories)' -d 'Run as if git was started in this directory' complete -x -c git -n '__fish_git_needs_command' -s c -a '(command git config -l 2>/dev/null | string replace = \t)' -d 'Set a configuration option' -complete -x -c git -n '__fish_git_needs_command' -l exec-path -a '(__fish_git_complete_directories)' -d 'Get or set the path to the git programs' +complete -x -c git -n '__fish_git_needs_command' -l exec-path -a '(__fish_complete_directories)' -d 'Get or set the path to the git programs' complete -f -c git -n '__fish_git_needs_command' -l html-path -d 'Print the path to the html documentation' complete -f -c git -n '__fish_git_needs_command' -l man-path -d 'Print the path to the man documentation' complete -f -c git -n '__fish_git_needs_command' -l info-path -d 'Print the path to the info documentation' complete -f -c git -n '__fish_git_needs_command' -s p -l paginate -d 'Pipe output into a pager' complete -f -c git -n '__fish_git_needs_command' -l no-pager -d 'Do not pipe output into a pager' -complete -f -c git -n '__fish_git_needs_command' -l git-dir -d 'Set the path to the repository' -complete -f -c git -n '__fish_git_needs_command' -l work-tree -d 'Set the path to the working tree' +complete -r -c git -n '__fish_git_needs_command' -l git-dir -d 'Set the path to the repository' +complete -r -c git -n '__fish_git_needs_command' -l work-tree -d 'Set the path to the working tree' complete -f -c git -n '__fish_git_needs_command' -l namespace -d 'Set the namespace' complete -f -c git -n '__fish_git_needs_command' -l bare -d 'Treat the repository as bare' complete -f -c git -n '__fish_git_needs_command' -l no-replace-objects -d 'Do not use replacement refs to replace git objects' @@ -1588,15 +1588,15 @@ complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcom complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from add' -l lock -d 'Lock working tree after creation' complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from add' -s q -l quiet -d 'Suppress feedback messages' complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from list' -l porcelain -d 'Output in an easy-to-parse format for scripts' -complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from lock' -a '(__fish_git_complete_worktrees)' +complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from lock' -a '(__fish_git_complete_worktrees)' -d 'Worktree' complete -x -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from lock' -l reason -d 'An explanation why the working tree is locked' -complete -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from move' -a '(__fish_git_complete_worktrees)' -complete -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from move' +complete -x -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from move; and not __fish_any_arg_in (__fish_git_complete_worktrees)' -a '(__fish_git_complete_worktrees)' -d 'Worktree' +complete -x -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from move; and __fish_any_arg_in (__fish_git_complete_worktrees)' -a '(__fish_complete_directories)' complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from prune' -s n -l dry-run -d 'Do not remove anything' complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from prune' -s v -l verbose -d 'Report all removals' complete -x -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from prune' -l expire -d 'Only expire unused working trees older than