Remove uninstall from tide completions

This commit is contained in:
Ilan Cosman 2020-07-13 21:07:11 -07:00
parent ad9f53b5d4
commit 914c6bc7c6
3 changed files with 8 additions and 7 deletions

View File

@ -1,7 +1,8 @@
set -l subcommands (printf '%s ' (basename -a -s '.fish' $_tide_dir/functions/*))
set -l uninstallIndex (contains -i uninstall $_tide_subcommands)
set -l subcommandsWithoutUninstall (printf '%s ' $_tide_subcommands[1..(math $uninstallIndex-1)] $_tide_subcommands[(math $uninstallIndex+1)..-1])
# Disable file completions for the entire command
complete -c tide -f
# Offer subcommands if no subcommand has been given so far
complete -c tide -n "not __fish_seen_subcommand_from $subcommands" -a $subcommands
complete -c tide -n "not __fish_seen_subcommand_from $subcommandsWithoutUninstall" -a $subcommandsWithoutUninstall

View File

@ -7,14 +7,13 @@ function tide
return 0
end
set -l tideSubcommand "tide_$subcommand"
set -l tideCommands (basename -a -s '.fish' $_tide_dir/functions/*)
set -l actual_command_name "tide_$subcommand"
if contains $subcommand $tideCommands
if contains $subcommand $_tide_subcommands
source "$_tide_dir/functions/$subcommand.fish"
$tideSubcommand $argv[2..-1]
$actual_command_name $argv[2..-1]
else
tide help
end
functions -e $tideSubcommand
functions -e $actual_command_name
end

View File

@ -79,6 +79,7 @@ function _set_immutables
_set_immutable _tide_version 2.0.0
_set_immutable _tide_dir "$__fish_config_dir/tide_theme"
_set_immutable _tide_subcommands (basename -s '.fish' $_tide_dir/functions/*)
# --------------Colors--------------
_set_immutable _tide_color_green 5FD700
_set_immutable _tide_color_light_blue 00AFFF