# ------------------------------------------------------------------------------ # Fish completion template for {{BIN_NAME}} # ------------------------------------------------------------------------------ # Installation: # {{BIN_NAME}} completions fish | source # # This file is generated from a template. Placeholders (for example # `{{TOP_LEVEL_COMMANDS}}`) are replaced with concrete completion definitions. # ------------------------------------------------------------------------------ # Fish offers file completion by default. Disable that globally first so command # words are preferred, then selectively re-enable `-F` where paths are expected. complete -c {{BIN_NAME}} -f # @description # Resolves and calls `xo-complete` for dynamic values (templates, invitations, # fields, etc.). We first try PATH, then a helper next to `{{BIN_NAME}}`. # @param $argv Arguments forwarded directly to xo-complete. function __{{FUNC_NAME}}_complete_dynamic set -l xo_complete_bin "" if command -q xo-complete set xo_complete_bin xo-complete else if command -q {{BIN_NAME}} set xo_complete_bin (dirname (command -s {{BIN_NAME}}))/xo-complete end if test -n "$xo_complete_bin" $xo_complete_bin $argv 2>/dev/null end end # Global option flags available across top-level command contexts. complete -c {{BIN_NAME}} -s h -d "Show help" complete -c {{BIN_NAME}} -l help -d "Show help" complete -c {{BIN_NAME}} -s v -d "Verbose output" complete -c {{BIN_NAME}} -l verbose -d "Verbose output" complete -c {{BIN_NAME}} -s o -d "Output file" complete -c {{BIN_NAME}} -l output -d "Output file" complete -c {{BIN_NAME}} -l currency -d "Set fiat display currency" # Dynamic completion for `-m/--mnemonic-file`. complete -c {{BIN_NAME}} -s m -l mnemonic-file -xa '(__{{FUNC_NAME}}_complete_dynamic mnemonics)' # Top-level command registrations inserted by template expansion. {{TOP_LEVEL_COMMANDS}} # Static subcommand registrations inserted by template expansion. {{STATIC_SUBCOMMANDS}} # --------------------------------------------------------------------------- # Dynamic completions by command/subcommand. # # Fish condition notes: # - `__fish_seen_subcommand_from ` checks whether `` exists in the # current tokenized command line. # - `count (commandline -opc)` returns how many tokens were entered. # We use this to infer positional argument index. # --------------------------------------------------------------------------- # invitation create