allows to search with id

This commit is contained in:
UndeadMaelys
2022-03-23 02:35:44 +01:00
parent 0d9f64bf58
commit 39335c7e09
5 changed files with 153 additions and 7 deletions

51
lexicon
View File

@@ -5,11 +5,14 @@ if not arg[1] then print("no argument, try again") return end
require "R2H2"
require "color"
adjustTableSizes = require "output_sizes"
printOutputTable = require "output_word"
showList = require "show_list"
searchList = require "search_list"
removeWord = require "remove_word"
addWord = require "add_word"
words = dofile("words.lua")
@@ -29,7 +32,7 @@ or arg[1] == "how"
or arg[1] == "howdo" then
print([[
[a]ll
[l]ist
- shows all words in heonian.
[h]elp
@@ -46,17 +49,17 @@ Parameters:
-c / --copy (copies transcription to keyboard)
-e / --english (limits the search to the translated words)
-h / --help (shows what does the command do)
-r / --raw (limits the search to the heonian words)
-r / --raw (limits the search to the heonian words)
-v / --verbose (shows the transcription process)
]])
return
end
if arg[1] == "a"
or arg[1] == "all" then
if arg[1] == "l"
or arg[1] == "list" then
if please_help then
print([[
[a]ll
[l]ist
- shows all words in heonian.
Parameters:
@@ -81,6 +84,7 @@ Parameters:
-a / --all (shows more info on the word, if any)
-e / --english (limits the search to the translated words)
-r / --raw (limits the search to the heonian words)
-i / --id (searches using word id)
]])
else
if arg[2] then searchList(arg[2])
@@ -107,3 +111,40 @@ Parameters:
return
end
end
if arg[1] == "r"
or arg[1] == "remove" then
if please_help then
print([[
[r]emove <word_id>
- removes the word from the lexicon
Parameters:
-h / --help (shows what does the command do)
]])
else
if arg[2] then removeWord(arg[2])
else print("no word to remove") end
return
end
end
if arg[1] == "a"
or arg[1] == "remove" then
if please_help then
print([[
[r]emove <word_id>
- removes the word from the lexicon
Parameters:
-h / --help (shows what does the command do)
]])
else
if arg[2] then addWord(...)
else print("no word to add") end
return
end
end