Pass flags from tide_install to _tide_actual_install fully (fixes #30)

This commit is contained in:
Ilan Cosman 2020-10-01 14:26:23 -07:00
parent 37390beee5
commit 432cc5cce6

View File

@ -1,12 +1,20 @@
function tide_install
# If git isn't installed, there's nothing we can do
if not command -q git
printf '%s\n' 'Git must be installed to download Tide.'
printf '%s\n' 'Git must be available to install Tide.'
return 1
end
argparse --ignore-unknown 'l/local' -- $argv
set -l options l/local u/unattended
argparse $options -- $argv
# Pass through options to _tide_actual_install
for option in $options
set -l longFormOption (string split '/' $option)[2]
if set -q _flag_$longFormOption
set -a flags "--$longFormOption"
end
end
set -l location $argv[-1]
if test -z "$location"
set location 'main'
@ -14,8 +22,6 @@ function tide_install
if set -q _flag_local
source "$location/tools/_tide_actual_install.fish"
set -a flags '-l'
else
curl --silent "https://raw.githubusercontent.com/IlanCosman/tide/$location/tools/_tide_actual_install.fish" | source
end