From d63ed4cb4985413eaef3cb0b9775497651999c0c Mon Sep 17 00:00:00 2001 From: Terje Larsen Date: Fri, 13 Nov 2015 12:03:36 +0100 Subject: [PATCH] style: generic cleanup --- share/fry/functions/fry-config.fish | 2 +- share/fry/functions/fry-current.fish | 4 ++-- share/fry/functions/fry-find.fish | 2 +- share/fry/functions/fry-use.fish | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/share/fry/functions/fry-config.fish b/share/fry/functions/fry-config.fish index 861e9e2..b21b0d3 100644 --- a/share/fry/functions/fry-config.fish +++ b/share/fry/functions/fry-config.fish @@ -1,6 +1,6 @@ function fry-config --description 'Configuration for fry' if test (count $argv) -eq 0 - set argv 'help' + set argv help end switch $argv[1] diff --git a/share/fry/functions/fry-current.fish b/share/fry/functions/fry-current.fish index 80471d9..e6155a1 100644 --- a/share/fry/functions/fry-current.fish +++ b/share/fry/functions/fry-current.fish @@ -17,7 +17,7 @@ function fry-current --description 'Show the current ruby' end end - set -l available_ruby_paths (printf '%s\n' $fry_rubies/(fry-ls)/bin) + set -l available_ruby_paths $fry_rubies/(fry-ls)/bin for p in $fish_user_paths if not contains $p $available_ruby_paths @@ -36,6 +36,6 @@ function fry-current --description 'Show the current ruby' if test $show_path -eq 1 dirname (type -p ruby) else - echo 'system' + echo system end end diff --git a/share/fry/functions/fry-find.fish b/share/fry/functions/fry-find.fish index dd16069..d2111bd 100644 --- a/share/fry/functions/fry-find.fish +++ b/share/fry/functions/fry-find.fish @@ -7,7 +7,7 @@ function fry-find --description 'Find ruby by name' return end - for i in (fry-ls | sort -r -n) + for i in (fry-ls | sort -rn) switch $i case "$name*" "$rubyless_name*" "ruby-$name*" echo $i diff --git a/share/fry/functions/fry-use.fish b/share/fry/functions/fry-use.fish index da8da6f..51a0c27 100644 --- a/share/fry/functions/fry-use.fish +++ b/share/fry/functions/fry-use.fish @@ -10,7 +10,7 @@ function fry-use --description 'Use the ruby given by ' set -l name $argv[1] set -l ruby $name - if test $name != 'system' + if test "$name" != system set ruby (fry-find $name) end @@ -29,7 +29,7 @@ function fry-use --description 'Use the ruby given by ' __fry_reset - if test $name = 'system' + if test "$name" = system echo 'Switched to system ruby' else set -l ruby_paths