add completion for zsh and .topography file to install script

This commit is contained in:
2024-08-10 13:58:36 -04:00
parent f1c4d79825
commit bc6c8cf0b8
3 changed files with 29 additions and 0 deletions

3
.topography Normal file
View File

@ -0,0 +1,3 @@
$$ export PREFIX=/usr/local
auto. #-> $PREFIX/bin
completion/_*.zsh #-> $PREFIX/share/zsh/site-functions/

View File

@ -34,3 +34,6 @@ ability to uninstall and install using just one line.
> [!Important] > [!Important]
> The `::` option is currently only supported on voidlinux, archlinux, and > The `::` option is currently only supported on voidlinux, archlinux, and
> debian. If you would like to expand compatibility send [me](mailto:me@zacharyscheiman.com) a patch. > debian. If you would like to expand compatibility send [me](mailto:me@zacharyscheiman.com) a patch.
## Installing
Incase you wish to install this script on your computer a .topography file has
been provided, to install simply run `./auto. -i`

23
completion/_auto.zsh Normal file
View File

@ -0,0 +1,23 @@
#compdef auto.
_arguments \
'1:flag:->flags' \
'*:: :->args'
case "$state" in
flags)
local -a opts
opts=(
'-t:Topography file'
'-i:Install dotfiles specified in the .topography file'
'-u:Uninstall dotfiles specified in the .topography file'
'-b:Exit at first error'
'-h:Show help text'
)
_describe 'flags' opts
;;
args)
case $line[1] in
-t) _files ;;
esac
esac