aboutsummaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorYour Name <you@example.com>2021-05-18 16:26:49 -0400
committerYour Name <you@example.com>2021-05-18 16:26:49 -0400
commit38e33d8756a5b652965be8ada478b5c4238b857c (patch)
treed4e3b166103c4c0cc8d3a4ed963333a2982bb366 /files
parente044fc4255aa64ef1dbc3d20ed87ed6e2f61a6bd (diff)
downloaddmtool-38e33d8756a5b652965be8ada478b5c4238b857c.tar.gz
dmtool-38e33d8756a5b652965be8ada478b5c4238b857c.tar.bz2
dmtool-38e33d8756a5b652965be8ada478b5c4238b857c.zip
Added spellcasting command
Diffstat (limited to 'files')
-rw-r--r--files/dmtool.bash12
1 files changed, 10 insertions, 2 deletions
diff --git a/files/dmtool.bash b/files/dmtool.bash
index ffc75f7..f683e05 100644
--- a/files/dmtool.bash
+++ b/files/dmtool.bash
@@ -81,7 +81,7 @@ _dmtool()
{
COMPREPLY=()
local cur="${COMP_WORDS[COMP_CWORD]}"
- local commands="ls cp mkdir mv rm attacks roll damage heal reset set edit add del help"
+ local commands="ls cp mkdir mv rm attacks roll damage heal reset set edit add del spellcasting help"
if [[ $COMP_CWORD -gt 1 ]]; then
local lastarg="${COMP_WORDS[$COMP_CWORD-1]}"
case "${COMP_WORDS[1]}" in
@@ -93,7 +93,7 @@ _dmtool()
_dmtool_complete_entries
fi
;;
- attacks|roll|damage|heal|set|edit|del)
+ attacks|roll|damage|heal|set|edit|del|spellcasting)
if [[ $COMP_CWORD -le 2 ]]; then
_dmtool_complete_entries
else
@@ -126,6 +126,14 @@ _dmtool()
#TODO: Add items and spells
_dmtool_complete_skills_abilities
;;
+ spellcasting)
+ if [[ $COMP_CWORD -eq 3 ]]; then
+ COMPREPLY+=($(compgen -W "init ability level" -- ${cur}))
+ elif [[ "$lastarg" == "ability" ]]; then
+ local IFS=$'\n'
+ COMPREPLY+=($(compgen -W "$(_dmtool_abilities)" -- ${cur}))
+ fi
+ ;;
esac
fi
;;