mirror of
https://github.com/jorgebucaran/fisher
synced 2024-10-09 09:36:53 +02:00
No-column print in ls and ls-remote if piping isatty stdout. Close #249.
This commit is contained in:
parent
33f4039f15
commit
4fe8b7987a
1 changed files with 10 additions and 2 deletions
12
fisher.fish
12
fisher.fish
|
@ -206,7 +206,11 @@ function fisher
|
|||
set -l count (count $items)
|
||||
|
||||
if test "$count" -ge 10
|
||||
printf "%s\n" $items | column -c$argv
|
||||
if isatty stdout
|
||||
printf "%s\n" $items | column -c$argv
|
||||
else
|
||||
printf "%s\n" $items | sed 's|^[@* ]*||'
|
||||
end
|
||||
|
||||
else if test "$count" -ge 1
|
||||
printf "%s\n" $items
|
||||
|
@ -234,7 +238,11 @@ function fisher
|
|||
if test -z "$format"
|
||||
set format "%name\n"
|
||||
|
||||
__fisher_list_remote "$format" $argv | column
|
||||
if isatty stdout
|
||||
__fisher_list_remote "$format" $argv | column
|
||||
else
|
||||
__fisher_list_remote "$format" $argv
|
||||
end
|
||||
else
|
||||
|
||||
__fisher_list_remote "$format" $argv
|
||||
|
|
Loading…
Reference in a new issue