fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
a53db7256
master
1# localization: skip(private) 2function __fish_print_zfs_snapshots -d"Lists ZFS snapshots" 3set fast_results( zfs list -o name -H) 4printf "%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) 8set current_token( commandline --current-token) 9set current_dataset( string replace -rf"([^@]+)@?.*" '$1' --$current_token ) 10set filtered_results( string match -ie --$current_dataset $fast_results ) 11if contains -- --force$argv || 12string match -ieq @ --$current_token || 13not set -q filtered_results[ 2 ] 14 15# Ignore errors because the dataset specified could be non-existent 16zfs list -t snapshot -o name -H -d1 $current_dataset 2> /dev/null 17end 18end