Add remove subcommand

This commit is contained in:
Ilan Cosman 2022-09-09 20:13:24 -04:00
parent 73c7b469aa
commit b970f41a38
2 changed files with 16 additions and 1 deletions

View File

@ -1,12 +1,15 @@
complete tide --no-files
set -l subcommands bug-report configure
set -l subcommands bug-report configure remove
complete tide -x -n __fish_use_subcommand -a bug-report -d "Print info for use in bug reports"
complete tide -x -n __fish_use_subcommand -a configure -d "Run the configuration wizard"
complete tide -x -n __fish_use_subcommand -a remove -d "Remove an item"
complete tide -x -n "not __fish_seen_subcommand_from $subcommands" -s h -l help -d "Print help message"
complete tide -x -n "not __fish_seen_subcommand_from $subcommands" -s v -l version -d "Print tide version"
complete tide -x -n '__fish_seen_subcommand_from bug-report' -l clean -d "Run clean Fish instance and install Tide"
complete tide -x -n '__fish_seen_subcommand_from bug-report' -l verbose -d "Print full Tide configuration"
complete tide -x -n '__fish_seen_subcommand_from remove' -a "\$tide_left_prompt_items \$tide_right_prompt_items"

View File

@ -0,0 +1,12 @@
function _tide_sub_remove
for item in $argv
if _tide_find_and_remove $item tide_left_prompt_items ||
_tide_find_and_remove $item tide_right_prompt_items
echo "Removed $item"
else
echo "$item not found"
end
end
_tide_cache_variables
return 0
end