Add zstd completions

Squashed commit of the following:

commit 55c8e73faff2418161404f012440acced09580e4
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Fri Nov 29 05:25:02 2019 +0900

    Implementation of `zstdless` completions

commit e81ae6f83fb9f23bdd6038fbf29ea594da098c2c
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Fri Nov 29 05:20:33 2019 +0900

    Implementation of `zstdgrep` completions

commit 2ade3a9c01bdc5b024f785c369fcb6c3e007cb19
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Fri Nov 29 04:50:42 2019 +0900

    Implementation of `pzstd` completions

commit 0b9cb86a6936f3de18db7b2c012da6efec89c8e8
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Fri Nov 29 04:39:52 2019 +0900

    Implementation of `zstdcat` completions

commit e4a4101d18a82fb06ee451560d079b9b81af5f3e
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Fri Nov 29 04:25:05 2019 +0900

    Implementation of `unzstd` completions

commit 88ad0af46d486a92ab3989c55abb3ff477e5a372
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Fri Nov 29 04:18:38 2019 +0900

    Implementation of `zstdmt` completions

commit 13f2bf7951501031c61a5c0f143b8a29eaa9437e
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Fri Nov 29 01:13:52 2019 +0900

    Implementation of `zstd` completions
This commit is contained in:
Shun Sakai 2019-11-29 07:18:33 +09:00 committed by Fabian Homborg
parent bc2634eaaf
commit 8d56609734
7 changed files with 208 additions and 0 deletions

View File

@ -0,0 +1,32 @@
# Completions for pzstd
complete -c pzstd -s d -l decompress -d "Decompress" -x -a "
(
__fish_complete_suffix .zst
)
"
complete -c pzstd -s t -l test -d "Test the integrity"
for level in (seq 1 19)
complete -c pzstd -o $level -d "Set compression level"
end
complete -c pzstd -l ultra -d "Enable compression level beyond 19"
for threads in (seq 1 (count (cat /proc/cpuinfo | string match -r "processor")))
complete -x -c pzstd -s p -l processes -a "$threads" -d "De/compress using $threads working threads"
end
complete -r -c pzstd -s o -d "Specify file to save"
complete -c pzstd -s f -l force -d "Overwrite without prompting"
complete -c pzstd -s c -l stdout -d "Force write to stdout"
complete -c pzstd -l rm -d "Remove input file(s) after de/compression"
complete -c pzstd -s k -l keep -d "Keep input file(s) (default)"
complete -c pzstd -s r -d "Recurse directories"
complete -c pzstd -s h -l help -d "Show help"
complete -c pzstd -s H -d "Show long help"
complete -c pzstd -s V -l version -d "Show version"
complete -c pzstd -s v -l verbose -d "Be verbose"
complete -c pzstd -s q -l quiet -d "Suppress warnings"
complete -c pzstd -l no-check -d "Disable integrity check"

View File

@ -0,0 +1,35 @@
# Completions for unzstd
complete -c unzstd -x -a "
(
__fish_complete_suffix .zst
)
"
complete -c unzstd -s t -l test -d "Test the integrity"
complete -r -c unzstd -l train -d "Create a dictionary from specified file(s)"
complete -c unzstd -s l -l list -d "List information about .zst file(s)"
complete -c unzstd -l long -d "Enable long distance matching with specified windowLog"
complete -c unzstd -l single-thread -d "Single-thread mode"
complete -r -c unzstd -s D -d "Use specified file as dictionary"
complete -r -c unzstd -s o -d "Specify file to save"
complete -c unzstd -s f -l force -d "Overwrite without prompting"
complete -c unzstd -s c -l stdout -d "Force write to stdout"
complete -c unzstd -l sparse -d "Enable sparse mode"
complete -c unzstd -l no-sparse -d "Disable sparse mode"
complete -c unzstd -l rm -d "Remove input file(s) after decompression"
complete -c unzstd -s k -l keep -d "Keep input file(s) (default)"
complete -c unzstd -s r -d "Recurse directories"
complete -c unzstd -l filelist -d "Read a list of files"
complete -c unzstd -l output-dir-flat -d "Specify a directory to output all files"
for format in zstd gzip xz lzma lz4
complete -c unzstd -l format="$format" -d "Specify the format to use for decompression"
end
complete -c unzstd -s h -l help -d "Show help"
complete -c unzstd -s H -d "Show long help"
complete -c unzstd -s V -l version -d "Show version"
complete -c unzstd -s v -l verbose -d "Be verbose"
complete -c unzstd -s q -l quiet -d "Suppress warnings"
complete -c unzstd -l no-progress -d "Do not show the progress bar"

View File

@ -0,0 +1,58 @@
# Completions for zstd
complete -c zstd -s z -l compress -d "Compress (default)"
complete -c zstd -s d -l decompress -l uncompress -d "Decompress" -x -a "
(
__fish_complete_suffix .zst
)
"
complete -c zstd -s t -l test -d "Test the integrity"
complete -r -c zstd -l train -d "Create a dictionary from specified file(s)"
complete -c zstd -s l -l list -d "List information about .zst file(s)"
for level in (seq 1 19)
complete -c zstd -o $level -d "Set compression level"
end
complete -c zstd -l fast -d "Ultra-fast compression"
complete -c zstd -l ultra -d "Enable compression level beyond 19"
complete -c zstd -l long -d "Enable long distance matching with specified windowLog"
for threads in (seq 0 (count (cat /proc/cpuinfo | string match -r "processor")))
if test $threads -eq 0
complete -c zstd -o T"$threads" -l threads="$threads" -d "Compress using as many threads as there are CPU cores on the system"
else
complete -c zstd -o T"$threads" -l threads="$threads" -d "Compress using $threads working threads"
end
end
complete -c zstd -l single-thread -d "Single-thread mode"
complete -c zstd -l adapt -d "Dynamically adapt compression level to I/O conditions"
complete -c zstd -l stream-size -d "Optimize compression parameters for streaming input of specified bytes"
complete -c zstd -l size-hint -d "Optimize compression parameters for streaming input of approximately this size"
complete -c zstd -l rsyncable -d "Compress using a rsync-friendly method"
complete -r -c zstd -s D -d "Use specified file as dictionary"
complete -c zstd -l no-dictID -d "Do not write dictID into header"
complete -r -c zstd -s o -d "Specify file to save"
complete -c zstd -s f -l force -d "Overwrite without prompting"
complete -c zstd -s c -l stdout -d "Force write to stdout"
complete -c zstd -l sparse -d "Enable sparse mode"
complete -c zstd -l no-sparse -d "Disable sparse mode"
complete -c zstd -l rm -d "Remove input file(s) after de/compression"
complete -c zstd -s k -l keep -d "Keep input file(s) (default)"
complete -c zstd -s r -d "Recurse directories"
complete -c zstd -l filelist -d "Read a list of files"
complete -c zstd -l output-dir-flat -d "Specify a directory to output all files"
for format in zstd gzip xz lzma lz4
complete -c zstd -l format="$format" -d "Specify the format to use for compression"
end
complete -c zstd -s h -l help -d "Show help"
complete -c zstd -s H -d "Show long help"
complete -c zstd -s V -l version -d "Show version"
complete -c zstd -s v -l verbose -d "Be verbose"
complete -c zstd -s q -l quiet -d "Suppress warnings"
complete -c zstd -l no-progress -d "Do not show the progress bar"
complete -c zstd -l no-check -d "Disable integrity check"

View File

@ -0,0 +1,28 @@
# Completions for zstdcat
complete -c zstdcat -x -a "
(
__fish_complete_suffix .zst
)
"
complete -c zstdcat -s t -l test -d "Test the integrity"
complete -c zstdcat -s l -l list -d "List information about .zst file(s)"
complete -c zstdcat -l long -d "Enable long distance matching with specified windowLog"
complete -c zstdcat -l single-thread -d "Single-thread mode"
complete -r -c zstdcat -s D -d "Use specified file as dictionary"
complete -c zstdcat -l sparse -d "Enable sparse mode"
complete -c zstdcat -l no-sparse -d "Disable sparse mode"
complete -c zstdcat -s r -d "Recurse directories"
complete -c zstdcat -l filelist -d "Read a list of files"
for format in zstd gzip xz lzma lz4
complete -c zstdcat -l format="$format" -d "Specify the format to use for decompression"
end
complete -c zstdcat -s h -l help -d "Show help"
complete -c zstdcat -s H -d "Show long help"
complete -c zstdcat -s V -l version -d "Show version"
complete -c zstdcat -s v -l verbose -d "Be verbose"
complete -c zstdcat -s q -l quiet -d "Suppress warnings"
complete -c zstdcat -l no-progress -d "Do not show the progress bar"

View File

@ -0,0 +1,3 @@
# Completions for zstdgrep
complete -c zstdgrep -w grep

View File

@ -0,0 +1,3 @@
# Completions for zstdless
complete -c zstdless -w zstdcat

View File

@ -0,0 +1,49 @@
# Completions for zstdmt
complete -c zstdmt -s z -l compress -d "Compress (default)"
complete -c zstdmt -s d -l decompress -l uncompress -d "Decompress" -x -a "
(
__fish_complete_suffix .zst
)
"
complete -c zstdmt -s t -l test -d "Test the integrity"
complete -r -c zstdmt -l train -d "Create a dictionary from specified file(s)"
complete -c zstdmt -s l -l list -d "List information about .zst file(s)"
for level in (seq 1 19)
complete -c zstdmt -o $level -d "Set compression level"
end
complete -c zstdmt -l fast -d "Ultra-fast compression"
complete -c zstdmt -l ultra -d "Enable compression level beyond 19"
complete -c zstdmt -l long -d "Enable long distance matching with specified windowLog"
complete -c zstdmt -l single-thread -d "Single-thread mode"
complete -c zstdmt -l adapt -d "Dynamically adapt compression level to I/O conditions"
complete -c zstdmt -l stream-size -d "Optimize compression parameters for streaming input of specified bytes"
complete -c zstdmt -l size-hint -d "Optimize compression parameters for streaming input of approximately this size"
complete -c zstdmt -l rsyncable -d "Compress using a rsync-friendly method"
complete -r -c zstdmt -s D -d "Use specified file as dictionary"
complete -c zstdmt -l no-dictID -d "Do not write dictID into header"
complete -r -c zstdmt -s o -d "Specify file to save"
complete -c zstdmt -s f -l force -d "Overwrite without prompting"
complete -c zstdmt -s c -l stdout -d "Force write to stdout"
complete -c zstdmt -l sparse -d "Enable sparse mode"
complete -c zstdmt -l no-sparse -d "Disable sparse mode"
complete -c zstdmt -l rm -d "Remove input file(s) after de/compression"
complete -c zstdmt -s k -l keep -d "Keep input file(s) (default)"
complete -c zstdmt -s r -d "Recurse directories"
complete -c zstdmt -l filelist -d "Read a list of files"
complete -c zstdmt -l output-dir-flat -d "Specify a directory to output all files"
for format in zstd gzip xz lzma lz4
complete -c zstdmt -l format="$format" -d "Specify the format to use for compression"
end
complete -c zstdmt -s h -l help -d "Show help"
complete -c zstdmt -s H -d "Show long help"
complete -c zstdmt -s V -l version -d "Show version"
complete -c zstdmt -s v -l verbose -d "Be verbose"
complete -c zstdmt -s q -l quiet -d "Suppress warnings"
complete -c zstdmt -l no-progress -d "Do not show the progress bar"
complete -c zstdmt -l no-check -d "Disable integrity check"