fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
6eaad2cd8
master
1# localization: tier1 2function isatty -d"Tests if a file descriptor is a tty" 3set -l options h/help 4argparse -n isatty$options --$argv 5or return 6 7if set -q _flag_help 8__fish_print_help isatty 9return 0 10end 11 12if set -q argv[ 2 ] 13{ 14 printf( _ "%s: Too many arguments" ) isatty 15echo 16} >&2 17return 1 18end 19 20set -l fd 21switch " $argv " 22case stdin'' 23set fd0 24case stdout 25set fd1 26case stderr 27set fd2 28case '*' 29set fd$argv [ 1 ] 30end 31 32test -t " $fd " 33end