Add custom path support for cli/tui in terminal config
This commit is contained in:
@@ -28,6 +28,21 @@ function __{{FUNC_NAME}}_complete_dynamic
|
||||
end
|
||||
end
|
||||
|
||||
# @description
|
||||
# Lists mnemonic aliases directly from the config directory without starting
|
||||
# the dynamic Node helper.
|
||||
function __{{FUNC_NAME}}_complete_mnemonics
|
||||
set -l config_dir "$XO_CONFIG_DIR"
|
||||
if test -z "$config_dir"
|
||||
set config_dir "$HOME/.config/xo-cli"
|
||||
end
|
||||
for file in $config_dir/mnemonics/mnemonic-*
|
||||
if test -f "$file"
|
||||
string replace -r '.*/' '' "$file"
|
||||
end
|
||||
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"
|
||||
@@ -37,8 +52,8 @@ 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)'
|
||||
# Shell-native completion for `-m/--mnemonic-file`.
|
||||
complete -c {{BIN_NAME}} -s m -l mnemonic-file -xa '(__{{FUNC_NAME}}_complete_mnemonics)'
|
||||
|
||||
# Top-level command registrations inserted by template expansion.
|
||||
{{TOP_LEVEL_COMMANDS}}
|
||||
|
||||
Reference in New Issue
Block a user