mirror of
https://github.com/acedanger/shell.git
synced 2026-03-24 23:41:50 -07:00
Commit local changes before merging with remote
This commit is contained in:
50
completions/env-backup-completion.bash
Normal file
50
completions/env-backup-completion.bash
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
# env-backup-completion.bash - Bash completion for environment backup scripts
|
||||
# Source this file or copy to ~/.local/share/bash-completion/completions/
|
||||
|
||||
_backup_env_files() {
|
||||
local cur prev opts
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
opts="--help --init --force --dry-run --restore --list --gitea-url --username"
|
||||
|
||||
case ${prev} in
|
||||
--gitea-url|-g)
|
||||
# Suggest common gitea URL patterns
|
||||
COMPREPLY=( $(compgen -W "https://git. https://gitea. https://code." -- ${cur}) )
|
||||
return 0
|
||||
;;
|
||||
--username|-u)
|
||||
# No completion for username
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
return 0
|
||||
}
|
||||
|
||||
_validate_env_backups() {
|
||||
local cur prev opts
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
opts="--help --verbose --summary-only --missing-only --diff"
|
||||
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
return 0
|
||||
}
|
||||
|
||||
# Register completion functions
|
||||
complete -F _backup_env_files backup-env-files.sh
|
||||
complete -F _validate_env_backups validate-env-backups.sh
|
||||
|
||||
# Also register for the full path versions
|
||||
complete -F _backup_env_files ./backup-env-files.sh
|
||||
complete -F _validate_env_backups ./validate-env-backups.sh
|
||||
Reference in New Issue
Block a user