Teach ls to handle multiple arguments. Close #243.

pull/445/head
Jorge Bucaran 9 years ago
parent 4b27433300
commit 566cfa5d8b
No known key found for this signature in database
GPG Key ID: E54BA3C0E646DB30

@ -1070,53 +1070,66 @@ function __fisher_list
end
function __fisher_list_plugin_directory -a item
set -l fd $__fisher_stderr
set -e argv[1]
set -l path "$fisher_config/$item"
function __fisher_list_plugin_directory
if test -z "$argv"
return 1
end
if test ! -d "$path"
__fisher_log error "$item is not installed" $__fisher_stderr
for item in $argv
if test ! -d "$fisher_config/$item"
__fisher_log error "@$item@ is not installed" $__fisher_stderr
return 1
return 1
end
end
pushd "$path"
set -l fd $__fisher_stderr
set -l uniq_items
set -l color (set_color $fish_color_command)
set -l nc (set_color normal)
set -l previous_tree
for item in $argv
if contains -- "$item" $uniq_items
continue
end
if contains -- --no-color $argv
set color
set nc
set fd $__fisher_stdout
end
set uniq_items $uniq_items "$item"
set -l path "$fisher_config/$item"
printf "$color%s$nc\n" "$PWD" > $fd
pushd "$path"
for file in .* **
if test -f "$file"
switch "$file"
case \*/\*
set -l current_tree (dirname $file)
set -l color (set_color $fish_color_command)
set -l nc (set_color normal)
set -l previous_tree
if test "$previous_tree" != "$current_tree"
printf " $color%s/$nc\n" $current_tree
end
if contains -- --no-color $argv
set color
set nc
set fd $__fisher_stdout
end
printf "$color%s$nc\n" "$PWD" > $fd
printf " %s\n" (basename $file)
for file in .* **
if test -f "$file"
switch "$file"
case \*/\*
set -l current_tree (dirname $file)
set previous_tree $current_tree
if test "$previous_tree" != "$current_tree"
printf " $color%s/$nc\n" $current_tree
end
case \*
printf " %s\n" $file
printf " %s\n" (basename $file)
set previous_tree $current_tree
case \*
printf " %s\n" $file
end
end
end
end > $fd
end > $fd
popd
popd
end
end

Loading…
Cancel
Save