From 3667b65b0415f31faee03e191f99ac704f845671 Mon Sep 17 00:00:00 2001 From: Marty Sluijtman Date: Wed, 1 Feb 2023 13:17:58 +0100 Subject: [PATCH] Spell additions - zsh completions - check spell amount --- main.go | 6 +++++- zsh.completion | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index eb6cd55..ed5c530 100644 --- a/main.go +++ b/main.go @@ -394,7 +394,11 @@ func listFeats() { } func listSpells(verbose bool) { - color.Magenta("Listing spells...") + if len(char.Spells) == 0 { + color.Magenta("%s has no spells\n", char.Misc.Name) + } else { + color.Magenta("Listing spells...") + } for i := 0; i < len(char.Spells); i++ { fmt.Printf("Name: %s\t%s\n", char.Spells[i].Name, spellLevel(char.Spells[i].Level)) fmt.Printf("Casting Time: %s\tRange: %dft\n", char.Spells[i].CastingTime, char.Spells[i].Range) diff --git a/zsh.completion b/zsh.completion index 1508dc4..c47ea99 100644 --- a/zsh.completion +++ b/zsh.completion @@ -1,6 +1,7 @@ #compdef sheet-parser arguments=( + '(--advantage --disadvantage --skill --save --stat --skill-list --stat-list -v --verbose --trivia -t)--spells[Print spell list' '(--advantage --disadvantage --skill --save --stat --skill-list --stat-list -v --verbose --trivia -t)--feats[Print charater feats]' '(--advantage --disadvantage --skill --save --stat --skill-list --stat-list -v --verbose --trivia -t --feats)--trivia[Print character trivia]' '(--advantage --disadvantage --skill --save --stat --skill-list --stat-list -v --verbose --trivia -t --feats)-t[Print character trivia]'