fork/fish-shell

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

Johannes AltmanningerMark private functions that don't need localizationa53db7256

master
820 B18 linesraw
1# localization: skip(private)
2function __fish_print_zfs_snapshots -d "Lists ZFS snapshots"
3    set fast_results (zfs list -o name -H)
4    printf "%s\n" $fast_results
5
6    # Don't retrieve all snapshots for all datasets until an @ is specified,
7    # or if there is only one possible matching dataset. (See #7472)
8    set current_token (commandline --current-token)
9    set current_dataset (string replace -rf "([^@]+)@?.*" '$1' -- $current_token)
10    set filtered_results (string match -ie -- $current_dataset $fast_results)
11    if contains -- --force $argv ||
12            string match -ieq @ -- $current_token ||
13            not set -q filtered_results[2]
14
15        # Ignore errors because the dataset specified could be non-existent
16        zfs list -t snapshot -o name -H -d 1 $current_dataset 2>/dev/null
17    end
18end