From b4bd1ed448f658e7135849d1221aefc78f826a28 Mon Sep 17 00:00:00 2001 From: "matthias@arch" Date: Mon, 4 Apr 2022 05:55:22 +0200 Subject: [PATCH] Added zsh completion script --- _nicole.compdef.zsh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 _nicole.compdef.zsh diff --git a/_nicole.compdef.zsh b/_nicole.compdef.zsh new file mode 100644 index 0000000..807bb0d --- /dev/null +++ b/_nicole.compdef.zsh @@ -0,0 +1,30 @@ +#compdef nicole +# https://zsh.sourceforge.io/Doc/Release/Completion-System.html#Completion-Functions +_lyrics-site() +{ + _values "lyrics site" \ + 'genius[use only genius.com]' \ + 'azlyrics[use only azlyrics.com]' \ + 'all[use all supported sites (default)]' +} + +_nicole() +{ + # each argument is + # n:message:action + # option[description]:message:action + # # -s allow stacking, eg -inr + _arguments -s \ + '-d[process directory]':directory:_directories \ + '-f[process file]':file:_files \ + '-r[go through directories recursively]' \ + '-s[silent]' \ + '-i[ignore history]' \ + '-n[do not write to history]' \ + '-o[overwrite if the file already has lyrics]' \ + '-t[test, only print lyrics, dont write to tags]' \ + '-h[show this]' \ + '--rm_explicit[remove the "Explicit" lyrics warning from the title tag]' \ + '--site[specify lyrics site]':lyrics-site:_lyrics-site +} +_nicole "$@"