diff options
author | Your Name <you@example.com> | 2023-11-21 16:26:34 -0500 |
---|---|---|
committer | Your Name <you@example.com> | 2023-11-21 16:26:34 -0500 |
commit | 0d32e0d3342ef2455014c8e1164977c816763317 (patch) | |
tree | 0e0a445332accf0eda8f23fe586f614844bee463 /files | |
parent | 5678a600b7d1ec4e79724258dfefe45a49258ea3 (diff) | |
download | dmtool-0d32e0d3342ef2455014c8e1164977c816763317.tar.gz dmtool-0d32e0d3342ef2455014c8e1164977c816763317.tar.bz2 dmtool-0d32e0d3342ef2455014c8e1164977c816763317.zip |
Added rudimentary item creation
Diffstat (limited to 'files')
-rw-r--r-- | files/dmtool.bash | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/files/dmtool.bash b/files/dmtool.bash index 0d7116f..677eb03 100644 --- a/files/dmtool.bash +++ b/files/dmtool.bash @@ -86,7 +86,7 @@ _dmtool() { COMPREPLY=() local cur="${COMP_WORDS[COMP_CWORD]}" - local commands="ls cp mkdir mv rm attacks roll attack damage heal save reset set edit add del spellcasting help git" + local commands="ls cp mkdir mv rm attacks roll attack damage heal save reset set edit add del spellcasting create help git" if [[ $COMP_CWORD -gt 1 ]]; then local lastarg="${COMP_WORDS[$COMP_CWORD-1]}" case "${COMP_WORDS[1]}" in @@ -114,7 +114,7 @@ _dmtool() _dmtool_complete_entries fi ;; - attacks|roll|attack|damage|heal|save|set|edit|del|spellcasting) + attacks|roll|attack|damage|heal|save|set|edit|del|create|spellcasting) if [[ $COMP_CWORD -le 2 ]]; then _dmtool_complete_entries else @@ -146,7 +146,7 @@ _dmtool() set) if [[ $COMP_CWORD -eq 3 ]]; then _dmtool_complete_skills_abilities - COMPREPLY+=($(compgen -W "proficiency name" -- ${cur})) + COMPREPLY+=($(compgen -W "proficiency name cost weight" -- ${cur})) elif [[ $COMP_CWORD -eq 4 ]]; then local skills="$(_dmtool_skills)" if [[ "$skills" =~ "$lastarg" ]]; then @@ -158,6 +158,11 @@ _dmtool() #TODO: Add items and spells _dmtool_complete_skills_abilities ;; + create) + if [[ $COMP_CWORD -eq 3 ]]; then + COMPREPLY+=($(compgen -W "item weapon armor spell feature feature_attack creature" -- ${cur})) + fi + ;; spellcasting) if [[ $COMP_CWORD -eq 3 ]]; then COMPREPLY+=($(compgen -W "init ability level" -- ${cur})) |