From 31bdc665b3a056d70bb85219bcccbc5cbb026416 Mon Sep 17 00:00:00 2001 From: Bizcochito Date: Tue, 22 Mar 2022 17:54:30 +0100 Subject: [PATCH] Done the usage help thing, with no actuall good help for now --- lexicon | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/lexicon b/lexicon index 00b0a37..b6d1165 100755 --- a/lexicon +++ b/lexicon @@ -2,6 +2,39 @@ if not arg[1] then print("no argument, try again") return end +for _, v in pairs(arg) do + if v == "-h" + or v == "--help" + or v == "--usage" + or v == "--howdo" + or v == "--how" + or arg[1] == "help" + or arg[1] == "how" + or arg[1] == "howdo" + then please_help = true end +end + +--USAGE COMMANDS +if please_help then + if arg[1] == "all" + or arg[1] == "a" then + print("all\n\tshows all words in heonian") + return + end + if arg[1] == "search" + or arg[1] == "s" then + print("search \n\tsearches all words and shows only those that return to string.find()") + return + end + if arg[1] == "transcript" + or arg[1] == "tr" then + print("transcript \n\ttranscripts the word to heonian script") + return + end + print("all\n\tshows all words in heonian\nsearch \n\tsearches all words and shows only those that return to string.find()\ntranscript \n\ttranscripts the word to heonian script") + return +end + require "R2H2" require "color" @@ -13,9 +46,9 @@ searchList = require "search_list" words = dofile("words.lua") -if arg[1] == "all" then - showList() - return +if arg[1] == "all" then + showList() + return end if arg[1] == "search" then if arg[2] then searchList(arg[2]) @@ -26,4 +59,4 @@ if arg[1] == "transcript" then if arg[2] then print(convertToHeonian(arg[2])) else print("no string found") end return -end \ No newline at end of file +end