summaryrefslogtreecommitdiff
path: root/share/spack/setup-env.fish
diff options
context:
space:
mode:
author百地 希留耶 <65301509+KiruyaMomochi@users.noreply.github.com>2023-07-22 21:55:12 +0800
committerGitHub <noreply@github.com>2023-07-22 08:55:12 -0500
commit90ac0ef66e3458dd022b78825637dd0d927e36ec (patch)
tree89ca0722413b7d1c96c6c16e5b2901ac4befe193 /share/spack/setup-env.fish
parent66e85ae39a99be74087f8b65df7bcadf6dff0d98 (diff)
downloadspack-90ac0ef66e3458dd022b78825637dd0d927e36ec.tar.gz
spack-90ac0ef66e3458dd022b78825637dd0d927e36ec.tar.bz2
spack-90ac0ef66e3458dd022b78825637dd0d927e36ec.tar.xz
spack-90ac0ef66e3458dd022b78825637dd0d927e36ec.zip
Implement fish completion (#29549)
* commands: provide more information to Command * fish: Add script to generate fish completion * fish: auto prepend `spack` command to avoid duplication * fish: impove completion generation code readability * commands: replace match-case with if-else * fish: fix optspec variable name prefix * fish: fix return value in get_optspecs * fish: fix return value in get_optspecs * format: split long line and trim trailing space * bugfix: replace f-string with interpolation * fish: compete more specs and some fixes * fish: complete hash spec starts with / * fish: improve compatibility * style: trim trailing whitespace * commands: add fish to update args and update tests * commands: add fish completion file * style: merge imports * fish: source completion in setup-env * fish: caret only completes dependencies * fish: make sure we always get same order of output * fish: spack activate only show installed packages that have extensions * fish: update completion file * fish: make dict keys sorted * Blacken code * Fix bad merge * Undo style changes to setup-env.fish * Fix unit tests * Style fix * Compatible with fish_indent * Use list for stability of order * Sort one more place * Sort more things * Sorting unneeded * Unsort * Print difference * Style fix * Help messages need quotes * Arguments to -a must be quoted * Update types * Update types * Update types * Add type hints * Change order of positionals * Always expand help * Remove shared base class * Fix type hints * Remove platform-specific choices * First line of help only * Remove unused maps * Remove suppress * Remove debugging comments * Better quoting * Fish completions have no double dash * Remove test for deleted class * Fix grammar in header file * Use single quotes in most places * Better support for remainder nargs * No magic strings * * and + can also complete multiple * lower case, no period --------- Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
Diffstat (limited to 'share/spack/setup-env.fish')
-rwxr-xr-xshare/spack/setup-env.fish8
1 files changed, 8 insertions, 0 deletions
diff --git a/share/spack/setup-env.fish b/share/spack/setup-env.fish
index 901ffe129f..482c3eaa68 100755
--- a/share/spack/setup-env.fish
+++ b/share/spack/setup-env.fish
@@ -785,7 +785,15 @@ if test -z "$SPACK_SKIP_MODULES"
sp_multi_pathadd MODULEPATH $_sp_tcl_roots
end
+# Add programmable tab completion for fish
+#
+set -l fish_version (string split '.' $FISH_VERSION)
+if test $fish_version[1] -gt 3
+ or test $fish_version[1] -eq 3
+ and test $fish_version[2] -ge 2
+ source $sp_share_dir/spack-completion.fish
+end
#
# NOTES