fork/fish-shell

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

Johannes AltmanningerMark private functions that don't need localizationa53db7256

master
689 B16 linesraw
1# localization: skip(private)
2function __fish_print_addresses --description "List own network addresses with interface as description"
3    # if --all is given, also print 0.0.0.0 and ::
4    if contains -- --all $argv
5        echo -e "0.0.0.0\tall"
6        echo -e "::\tall"
7    end
8    if command -sq ip
9        command ip --oneline address | string replace -r '^\d+:\s+(\S+)\s+inet6?\s+([^\s/]+).*' '$2\t$1'
10    else if command -sq ifconfig
11        # This is for OSX/BSD
12        # There's also linux ifconfig but that has at least two different output formats
13        # is basically dead, and ip is installed on everything now
14        ifconfig | awk '/^\tinet/ { print $2 } '
15    end
16end