From 0d32e0d3342ef2455014c8e1164977c816763317 Mon Sep 17 00:00:00 2001
From: Your Name <you@example.com>
Date: Tue, 21 Nov 2023 16:26:34 -0500
Subject: Added rudimentary item creation

---
 files/dmtool.bash | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

(limited to 'files')

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}))
-- 
cgit v1.2.3