diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index 4389081..86ee5d8 100644 --- a/.config/zsh/.zprofile +++ b/.config/zsh/.zprofile @@ -2,6 +2,7 @@ # Directories export PATH="$PATH:$HOME/.scripts" +export FPATH="$FPATH:$HOME/.scripts/completion" export XDG_CACHE_HOME="$HOME/.cache" export XDG_CONFIG_HOME="$HOME/.config" export XDG_DATA_HOME="$HOME/.local/share" diff --git a/.scripts/completion/_dotfiles.sh b/.scripts/completion/_dotfiles.sh new file mode 100755 index 0000000..2a16ba3 --- /dev/null +++ b/.scripts/completion/_dotfiles.sh @@ -0,0 +1,24 @@ +#compdef dotfiles.sh + +_dotfiles.sh() { + integer ret=1 + local -a args + + args+=( + '(- *)'{-a,--add}'[add file to the dotfiles directory]:file:_files' + '(- *)'{-f,--files}'[display all files added to the dotfiles directory]' + '(- *)'{-h,--help}'[display usage message and exit]' + '(- *)'{-p,--packages}'[instal, list or store packages]:packages:(( + install\:"install all core packages of the stored list" + list\:"display all packages installed on the system (default)" + store\:"stores a list of all installed packages" + ))' + '(- *)'{-l,--pull}'[pull each added file from system to dotfiles directory]' + '(- *)'{-s,--push}'[push each added file to its location on the system]' + ) + + _arguments $args[@] && ret=0 + return ret +} + +_dotfiles.sh diff --git a/dotfiles.sh b/dotfiles.sh index f966892..eeaa5d2 100755 --- a/dotfiles.sh +++ b/dotfiles.sh @@ -25,7 +25,7 @@ ${B}NAME${N} dotfiles - file copy script for the dotfiles repository ${B}SYNOPSIS${N} - ./dotfiles.sh [] + ./dotfiles.sh