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

Adding fish completions based on bash completions and fish git comple… #90

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixing alias completions; had only tested with a single alias previously
  • Loading branch information
mclark-newvistas committed Jun 18, 2018
commit 348d924fdb902c8ebb4d37137a4f5a6d5d8f631a
10 changes: 7 additions & 3 deletions bin/hcl.fish
Original file line number Diff line number Diff line change
@@ -34,10 +34,14 @@ function __fish_hcl_tasks
hcl tasks | grep "^$customer" | awk -F "\t" '{ split($1,a," "); split($2,b," - "); print a[2] "\t" b[3] }'
end

function __fish_hcl_aliases
hcl aliases | sed -e "s/, /\n/g"
end

complete -c hcl -n '__fish_hcl_needs_command' -f -a "start resume log stop note show tasks alias unalias aliases cancel nvm oops config status"
complete -c hcl -n '__fish_hcl_using_command start' -f -a '(hcl aliases | sed -e "s/,//g")'
complete -c hcl -n '__fish_hcl_using_command resume' -f -a '(hcl aliases | sed -e "s/,//g")'
complete -c hcl -n '__fish_hcl_using_command log' -f -a '(hcl aliases | sed -e "s/,//g")'
complete -c hcl -n '__fish_hcl_using_command start' -f -a '(__fish_hcl_aliases)'
complete -c hcl -n '__fish_hcl_using_command resume' -f -a '(__fish_hcl_aliases)'
complete -c hcl -n '__fish_hcl_using_command log' -f -a '(__fish_hcl_aliases)'
complete -c hcl -n '__fish_hcl_using_command alias' -f
complete -c hcl -n '__fish_hcl_using_command alias; and __fish_hcl_arg_count 3' -a '(__fish_hcl_customers)'
complete -c hcl -n '__fish_hcl_using_command alias; and __fish_hcl_arg_count 4' -a '(__fish_hcl_tasks)'