fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
c12f853db
master
1# Filter Completion 2function __fish_btrbk_complete_filter 3btrbk list config --format col:h:snapshot_name,source_subvolume,target_url| string replace -r'([^ ]+)\s+([^ ]+)\s+([^ ]*)' '$1\t$2 -> $3' 4end 5 6# options with arguments 7complete -c btrbk -l format -x -d'Change output format' -a"table long raw" 8complete -c btrbk -l loglevel -s l -x -d'Set logging level' -a"error warn info debug trace" 9complete -c btrbk -l exclude -x -d'Exclude configured sections' -a"(__fish_btrbk_complete_filter)" 10complete -c btrbk -l override -x -d'Globally override a configuration option' 11 12# options with file completion 13complete -c btrbk -l config -r -s c -d'Specify configuration file' 14complete -c btrbk -l lockfile -r -d'Create and check lockfile' 15 16# options without arguments 17complete -c btrbk -l help -s h -d'Display this help message' 18complete -c btrbk -l version -d'Display version information' 19complete -c btrbk -l dry-run -s n -d'Perform a trial run with no changes made' 20complete -c btrbk -l preserve -s p -d'Preserve all (do not delete anything)' 21complete -c btrbk -l preserve-snapshots -d'Preserve snapshots (do not delete snapshots)' 22complete -c btrbk -l preserve-backups -d'Preserve backups (do not delete backups)' 23complete -c btrbk -l wipe -d'Delete all but latest snapshots' 24complete -c btrbk -l verbose -s v -d'Be more verbose (increase logging level)' 25complete -c btrbk -l quiet -s q -d'Be quiet (do not print backup summary)' 26complete -c btrbk -l table -s t -d'Change output to table format' 27complete -c btrbk -l long -s L -d'Change output to long format' 28complete -c btrbk -l print-schedule -s S -d'Print scheduler details (for the "run" command)' 29complete -c btrbk -l progress -d'Show progress bar on send-receive operation' 30 31# uncommon options from manpage 32complete -c btrbk -l single-column -s1 -d'Print output as a single column' 33complete -c btrbk -l pretty -d'Print pretty table output with lowercase and underlined column headings' 34complete -c btrbk -l raw -d'Create raw targets for archive command' 35 36# subcommands 37complete -c btrbk -f -n __fish_use_subcommand -a run -d'Run snapshot and backup operations' 38complete -c btrbk -f -n __fish_use_subcommand -a dryrun -d'Show what would be executed without running btrfs commands' 39complete -c btrbk -f -n __fish_use_subcommand -a snapshot -d'Run snapshot operations only' 40complete -c btrbk -f -n __fish_use_subcommand -a resume -d'Run backup operations and delete snapshots' 41complete -c btrbk -f -n __fish_use_subcommand -a prune -d'Only delete snapshots and backups' 42complete -c btrbk -f -n __fish_use_subcommand -a archive -d'Recursively copy all subvolumes (src -> dst)' 43complete -c btrbk -f -n __fish_use_subcommand -a clean -d'Delete incomplete (garbled) backups' 44complete -c btrbk -f -n __fish_use_subcommand -a stats -d'Print snapshot/backup statistics' 45complete -c btrbk -f -n __fish_use_subcommand -a usage -d'Print filesystem usage' 46complete -c btrbk -f -n __fish_use_subcommand -a ls -d'List all btrfs subvolumes below a given path' 47complete -c btrbk -f -n __fish_use_subcommand -a origin -d'Print origin information for a subvolume' 48complete -c btrbk -f -n __fish_use_subcommand -a diff -d'List file changes between related subvolumes' 49complete -c btrbk -f -n __fish_use_subcommand -a extents -d'Calculate accurate disk space usage for a path' 50complete -c btrbk -f -n __fish_use_subcommand -a list -d'List snapshots and backups' 51 52# subsubcommands for "list" 53complete -c btrbk -n'__fish_seen_subcommand_from list' -f -a all -d'List all snapshots and backups' 54complete -c btrbk -n'__fish_seen_subcommand_from list' -f -a snapshots -d'List snapshots only' 55complete -c btrbk -n'__fish_seen_subcommand_from list' -f -a backups -d'List backups and correlated snapshots' 56complete -c btrbk -n'__fish_seen_subcommand_from list' -f -a latest -d'List most recent snapshots and backups' 57complete -c btrbk -n'__fish_seen_subcommand_from list' -f -a config -d'List configured source/snapshot/target relations' 58complete -c btrbk -n'__fish_seen_subcommand_from list' -f -a source -d'List configured source/snapshot relations' 59complete -c btrbk -n'__fish_seen_subcommand_from list' -f -a volume -d'List configured volume sections' 60complete -c btrbk -n'__fish_seen_subcommand_from list' -f -a target -d'List configured targets' 61 62complete -c btrbk -n'__fish_seen_subcommand_from run dryrun snapshot resume prune clean' -x -a'(__fish_btrbk_complete_filter)'