diff --git a/completions/tide.fish b/completions/tide.fish index a9aae05..a02ec04 100644 --- a/completions/tide.fish +++ b/completions/tide.fish @@ -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 \ No newline at end of file +complete -c tide -n "not __fish_seen_subcommand_from $subcommandsWithoutUninstall" -a $subcommandsWithoutUninstall \ No newline at end of file diff --git a/functions/tide.fish b/functions/tide.fish index 1e76619..9201b43 100644 --- a/functions/tide.fish +++ b/functions/tide.fish @@ -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 \ No newline at end of file diff --git a/tools/tide_actual_install.fish b/tools/tide_actual_install.fish index 47002c6..b39b140 100644 --- a/tools/tide_actual_install.fish +++ b/tools/tide_actual_install.fish @@ -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