fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Johannes AltmanningerRemove some redundant translation sources6eaad2cd8

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