aboutsummaryrefslogtreecommitdiffstats
path: root/src/_rmlint
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2021-08-27 11:14:17 +0200
committerOliver Kiddle <opk@zsh.org>2021-08-27 11:14:17 +0200
commit99a6b6cb6ece3e09e60770a43522582dbe08d5cc (patch)
treebedfe512277180844f895abaf9cf261cc97a44f3 /src/_rmlint
parentMerge pull request #815 from yut23/patch-1 (diff)
downloadzsh-completions-99a6b6cb6ece3e09e60770a43522582dbe08d5cc.tar
zsh-completions-99a6b6cb6ece3e09e60770a43522582dbe08d5cc.tar.gz
zsh-completions-99a6b6cb6ece3e09e60770a43522582dbe08d5cc.tar.bz2
zsh-completions-99a6b6cb6ece3e09e60770a43522582dbe08d5cc.tar.lz
zsh-completions-99a6b6cb6ece3e09e60770a43522582dbe08d5cc.tar.xz
zsh-completions-99a6b6cb6ece3e09e60770a43522582dbe08d5cc.tar.zst
zsh-completions-99a6b6cb6ece3e09e60770a43522582dbe08d5cc.zip
combine _rmlint.sh into _rmlint
The usual zsh approach is one function switching on $service and the .sh extension seems to cause some people problems with their setups.
Diffstat (limited to 'src/_rmlint')
-rw-r--r--src/_rmlint17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/_rmlint b/src/_rmlint
index 2b6f141..92af0c6 100644
--- a/src/_rmlint
+++ b/src/_rmlint
@@ -1,4 +1,4 @@
-#compdef rmlint
+#compdef rmlint rmlint.sh -P rmlint.*.sh
# Copyright (c) 2021 Github zsh-users - http://github.com/zsh-users
#
@@ -284,6 +284,21 @@ _rmlint_files_or_separator() {
}
_rmlint() {
+ if [[ $service = *.sh ]]; then
+ _arguments -s : \
+ '(-)-h[show help message]' \
+ '-d[do not ask before running]' \
+ '-x[keep rmlint.sh; do not autodelete it]' \
+ '-p[recheck that files are still identical before removing duplicates]' \
+ '-r[allow deduplication of files on read-only btrfs snapshots (requires sudo)]' \
+ '(-d -x)-n[do not perform any modifications, just print what would be done (implies -d and -x)]' \
+ '-c[clean up empty directories while deleting duplicates]' \
+ '-q[do not show progress]' \
+ '-k[keep the timestamp of directories when removing duplicates]' \
+ '-i[ask before deleting each file]'
+ return
+ fi
+
local curcontext="$curcontext" state state_descr
local -a line
local -i ret=1