neue Optionen (-r, Installskript) installiert

This commit is contained in:
Dieter Schlüter 2026-02-10 15:38:53 +01:00
commit d78e318d8a
15 changed files with 273 additions and 42 deletions

View file

@ -7,6 +7,8 @@ _ntu() {
typeset -A opt_args
_arguments -C \
'(-r --recursive)'{-r,--recursive}'[Process directories recursively]' \
'--conf[Use specific configuration file]:config file:_files' \
'(-n --dry-run --no-changes)'{-n,--dry-run,--no-changes}'[Only preview changes without renaming]' \
'(-q --quiet)'{-q,--quiet}'[Suppress output]' \
'(-f --force)'{-f,--force}'[Overwrite existing files]' \
@ -14,6 +16,7 @@ _ntu() {
'(-v --verbose)'{-v,--verbose}'[Verbose debug output]' \
'--modify-root[Also rename root directory]' \
'--special[Process symlinks and special files]' \
'--no-color[Disable colored output]' \
'(-h --help)'{-h,--help}'[Print help]' \
'(-V --version)'{-V,--version}'[Print version]' \
'*:path:_files'

View file

@ -7,7 +7,7 @@ _ntu_completion() {
prev="${COMP_WORDS[COMP_CWORD-1]}"
# All available options
opts="--dry-run --no-changes --quiet --force --exclude --verbose --modify-root --special --help --version -n -q -f -e -v -h -V"
opts="--recursive --conf --dry-run --no-changes --quiet --force --exclude --verbose --modify-root --special --no-color --help --version -r -n -q -f -e -v -h -V"
# Handle options that require arguments
case "${prev}" in
@ -16,6 +16,11 @@ _ntu_completion() {
COMPREPLY=( $(compgen -W '"*.tmp" "*.log" "*.bak" "*.swp" "*~"' -- ${cur}) )
return 0
;;
--conf)
# Suggest files for config option
COMPREPLY=( $(compgen -f -- ${cur}) )
return 0
;;
*)
;;
esac

View file

@ -4,6 +4,8 @@
complete -c ntu -f -d 'Sanitize file and directory names to Unix conventions'
# Options
complete -c ntu -s r -l recursive -d 'Process directories recursively'
complete -c ntu -l conf -d 'Use specific configuration file' -r -F
complete -c ntu -s q -l quiet -d 'Suppress output (no rename information)'
complete -c ntu -s n -l dry-run -d 'Show what would be renamed without making changes'
complete -c ntu -l no-changes -d 'Alias for --dry-run'