Add config printing, explain mode, completions, and docs

This commit is contained in:
2025-12-30 13:45:26 -05:00
parent 18010798bb
commit 1f61efff5c
15 changed files with 555 additions and 19 deletions

70
completions/_mov-renamarr Normal file
View File

@@ -0,0 +1,70 @@
#compdef mov-renamarr
autoload -U is-at-least
_mov-renamarr() {
typeset -A opt_args
typeset -a _arguments_options
local ret=1
if is-at-least 5.2; then
_arguments_options=(-s -S -C)
else
_arguments_options=(-s -C)
fi
local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" : \
'--input=[]:DIR:_files' \
'--output=[]:DIR:_files' \
'--config=[]:PATH:_files' \
'--provider=[]:PROVIDER:(auto omdb tmdb both)' \
'--api-key-omdb=[]:API_KEY_OMDB:_default' \
'--api-key-tmdb=[]:API_KEY_TMDB:_default' \
'--cache=[]:PATH:_files' \
'--report=[]' \
'--report-format=[]:REPORT_FORMAT:(text json csv)' \
'--min-score=[]:MIN_SCORE:_default' \
'--quality-tags=[]:LIST:_default' \
'--color=[]:COLOR:(auto always never)' \
'--llm-mode=[]:LLM_MODE:(off parse assist)' \
'--llm-endpoint=[]:URL:_default' \
'--llm-model=[]:NAME:_default' \
'--llm-timeout=[]:SECONDS:_default' \
'--llm-max-tokens=[]:N:_default' \
'--jobs=[]:JOBS:_default' \
'--net-jobs=[]:NET_JOBS:_default' \
'--completions=[]:COMPLETIONS:(bash zsh fish)' \
'--refresh-cache[]' \
'--dry-run[]' \
'--dry-run-summary[]' \
'(--rename-in-place)--move[]' \
'(--move)--rename-in-place[]' \
'--interactive[]' \
'--sidecar-notes[]' \
'--sidecars[]' \
'--overwrite[]' \
'--suffix[]' \
'--include-id[]' \
'--no-lookup[]' \
'--explain[]' \
'--print-config[]' \
'--verbose[]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
}
(( $+functions[_mov-renamarr_commands] )) ||
_mov-renamarr_commands() {
local commands; commands=()
_describe -t commands 'mov-renamarr commands' commands "$@"
}
if [ "$funcstack[1]" = "_mov-renamarr" ]; then
_mov-renamarr "$@"
else
compdef _mov-renamarr mov-renamarr
fi

View File

@@ -0,0 +1,126 @@
_mov-renamarr() {
local i cur prev opts cmd
COMPREPLY=()
if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then
cur="$2"
else
cur="${COMP_WORDS[COMP_CWORD]}"
fi
prev="$3"
cmd=""
opts=""
for i in "${COMP_WORDS[@]:0:COMP_CWORD}"
do
case "${cmd},${i}" in
",$1")
cmd="mov__renamarr"
;;
*)
;;
esac
done
case "${cmd}" in
mov__renamarr)
opts="-h -V --input --output --config --provider --api-key-omdb --api-key-tmdb --cache --refresh-cache --dry-run --dry-run-summary --move --rename-in-place --interactive --report --report-format --sidecar-notes --sidecars --overwrite --suffix --min-score --include-id --quality-tags --color --llm-mode --llm-endpoint --llm-model --llm-timeout --llm-max-tokens --jobs --net-jobs --no-lookup --explain --print-config --completions --verbose --help --version"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--input)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--output)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--config)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--provider)
COMPREPLY=($(compgen -W "auto omdb tmdb both" -- "${cur}"))
return 0
;;
--api-key-omdb)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--api-key-tmdb)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--cache)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--report)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--report-format)
COMPREPLY=($(compgen -W "text json csv" -- "${cur}"))
return 0
;;
--min-score)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--quality-tags)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--color)
COMPREPLY=($(compgen -W "auto always never" -- "${cur}"))
return 0
;;
--llm-mode)
COMPREPLY=($(compgen -W "off parse assist" -- "${cur}"))
return 0
;;
--llm-endpoint)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--llm-model)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--llm-timeout)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--llm-max-tokens)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--jobs)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--net-jobs)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--completions)
COMPREPLY=($(compgen -W "bash zsh fish" -- "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
esac
}
if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then
complete -F _mov-renamarr -o nosort -o bashdefault -o default mov-renamarr
else
complete -F _mov-renamarr -o bashdefault -o default mov-renamarr
fi

View File

@@ -0,0 +1,48 @@
complete -c mov-renamarr -l input -r -F
complete -c mov-renamarr -l output -r -F
complete -c mov-renamarr -l config -r -F
complete -c mov-renamarr -l provider -r -f -a "auto\t''
omdb\t''
tmdb\t''
both\t''"
complete -c mov-renamarr -l api-key-omdb -r
complete -c mov-renamarr -l api-key-tmdb -r
complete -c mov-renamarr -l cache -r -F
complete -c mov-renamarr -l report -r -F
complete -c mov-renamarr -l report-format -r -f -a "text\t''
json\t''
csv\t''"
complete -c mov-renamarr -l min-score -r
complete -c mov-renamarr -l quality-tags -r
complete -c mov-renamarr -l color -r -f -a "auto\t''
always\t''
never\t''"
complete -c mov-renamarr -l llm-mode -r -f -a "off\t''
parse\t''
assist\t''"
complete -c mov-renamarr -l llm-endpoint -r
complete -c mov-renamarr -l llm-model -r
complete -c mov-renamarr -l llm-timeout -r
complete -c mov-renamarr -l llm-max-tokens -r
complete -c mov-renamarr -l jobs -r
complete -c mov-renamarr -l net-jobs -r
complete -c mov-renamarr -l completions -r -f -a "bash\t''
zsh\t''
fish\t''"
complete -c mov-renamarr -l refresh-cache
complete -c mov-renamarr -l dry-run
complete -c mov-renamarr -l dry-run-summary
complete -c mov-renamarr -l move
complete -c mov-renamarr -l rename-in-place
complete -c mov-renamarr -l interactive
complete -c mov-renamarr -l sidecar-notes
complete -c mov-renamarr -l sidecars
complete -c mov-renamarr -l overwrite
complete -c mov-renamarr -l suffix
complete -c mov-renamarr -l include-id
complete -c mov-renamarr -l no-lookup
complete -c mov-renamarr -l explain
complete -c mov-renamarr -l print-config
complete -c mov-renamarr -l verbose
complete -c mov-renamarr -s h -l help -d 'Print help'
complete -c mov-renamarr -s V -l version -d 'Print version'