diff options
Diffstat (limited to 'completions')
| -rw-r--r-- | completions/foostore.fish | 33 | ||||
| -rw-r--r-- | completions/ge.fish | 22 | ||||
| -rw-r--r-- | completions/geheim.fish | 33 |
3 files changed, 44 insertions, 44 deletions
diff --git a/completions/foostore.fish b/completions/foostore.fish new file mode 100644 index 0000000..88056f1 --- /dev/null +++ b/completions/foostore.fish @@ -0,0 +1,33 @@ +# Fish completion for foostore +# Install to ~/.config/fish/completions/foostore.fish + +# Dynamically load commands from foostore +function __fish_foostore_commands + foostore commands 2>/dev/null +end + +# Get list of entries for completion +function __fish_foostore_entries + # Only run if PIN is set to avoid interactive prompt + if set -q PIN + foostore ls 2>/dev/null | string replace -r ';.*$' '' | string trim + end +end + +# Complete subcommands +complete -c foostore -f -n "__fish_use_subcommand" -a "(__fish_foostore_commands)" + +# Complete search terms for commands that need them +complete -c foostore -f -n "__fish_seen_subcommand_from search cat paste export pathexport open edit rm" -a "(__fish_foostore_entries)" + +# Complete file paths for import +complete -c foostore -n "__fish_seen_subcommand_from import" -F + +# Complete directory paths for import destination +complete -c foostore -n "__fish_seen_subcommand_from import; and __fish_is_nth_token 3" -F -a "(__fish_complete_directories)" + +# Force flag for import +complete -c foostore -n "__fish_seen_subcommand_from import; and __fish_is_nth_token 4" -f -a "force" + +# Complete directory paths for import_r +complete -c foostore -n "__fish_seen_subcommand_from import_r" -F -a "(__fish_complete_directories)" diff --git a/completions/ge.fish b/completions/ge.fish index 8a1206a..ae723b1 100644 --- a/completions/ge.fish +++ b/completions/ge.fish @@ -1,35 +1,35 @@ -# Fish wrapper and completion for ge (geheim shortcut) +# Fish wrapper and completion for ge (foostore shortcut) # Install to ~/.config/fish/functions/ge.fish -function ge --description 'Geheim wrapper with shortcuts' +function ge --description 'foostore wrapper with shortcuts' # If no arguments, run interactive mode if test (count $argv) -eq 0 - geheim shell + foostore shell return $status end set -l cmd $argv[1] - + # Check if first argument is a known command - if contains $cmd (geheim commands 2>/dev/null) - # It's a command, pass through to geheim - geheim $argv + if contains $cmd (foostore commands 2>/dev/null) + # It's a command, pass through to foostore + foostore $argv else # Not a command, treat as search term - geheim search $argv + foostore search $argv end end -# Dynamically load commands from geheim +# Dynamically load commands from foostore function __fish_ge_commands - geheim commands 2>/dev/null + foostore commands 2>/dev/null end # Get list of entries for completion function __fish_ge_entries # Only run if PIN is set to avoid interactive prompt if set -q PIN - geheim ls 2>/dev/null | string replace -r ';.*$' '' | string trim + foostore ls 2>/dev/null | string replace -r ';.*$' '' | string trim end end diff --git a/completions/geheim.fish b/completions/geheim.fish deleted file mode 100644 index c36ad03..0000000 --- a/completions/geheim.fish +++ /dev/null @@ -1,33 +0,0 @@ -# Fish completion for geheim -# Install to ~/.config/fish/completions/geheim.fish - -# Dynamically load commands from geheim -function __fish_geheim_commands - geheim commands 2>/dev/null -end - -# Get list of entries for completion -function __fish_geheim_entries - # Only run if PIN is set to avoid interactive prompt - if set -q PIN - geheim ls 2>/dev/null | string replace -r ';.*$' '' | string trim - end -end - -# Complete subcommands -complete -c geheim -f -n "__fish_use_subcommand" -a "(__fish_geheim_commands)" - -# Complete search terms for commands that need them -complete -c geheim -f -n "__fish_seen_subcommand_from search cat paste export pathexport open edit rm" -a "(__fish_geheim_entries)" - -# Complete file paths for import -complete -c geheim -n "__fish_seen_subcommand_from import" -F - -# Complete directory paths for import destination -complete -c geheim -n "__fish_seen_subcommand_from import; and __fish_is_nth_token 3" -F -a "(__fish_complete_directories)" - -# Force flag for import -complete -c geheim -n "__fish_seen_subcommand_from import; and __fish_is_nth_token 4" -f -a "force" - -# Complete directory paths for import_r -complete -c geheim -n "__fish_seen_subcommand_from import_r" -F -a "(__fish_complete_directories)" |
