diff --git a/output_sizes.lua b/output_sizes.lua index 3b0684e..f45361a 100644 --- a/output_sizes.lua +++ b/output_sizes.lua @@ -17,6 +17,7 @@ return function(tbl) for i=1, #words do for j=1, #words[i]-1 do + if j > 3 then break end local times = words_max_length[j+1] - string.len(words[i][j]) while times > 0 do words[i][j] = words[i][j] .. " " diff --git a/output_word.lua b/output_word.lua index 5755365..e668872 100644 --- a/output_word.lua +++ b/output_word.lua @@ -1,4 +1,9 @@ return function(tbl) + local show_all = false + for _, v in pairs(arg) do + if v == "-a" or v == "--all" then show_all = true end + end + for i=1, #tbl do local this_number = tbl[i][1] local this_word = tbl[i][2] @@ -14,8 +19,20 @@ return function(tbl) text = text .. colorTextBackground(COLOR.Black,colorText(COLOR.Green,this_word[2])) print(text) - text = "" - text = text .. colorTextBackground(COLOR.Black,colorText(COLOR.Blue,this_word[4])) - text = text .. colorTextBackground(COLOR.Black,colorText(COLOR.Blue,this_word[5])) + if show_all then + text = "" + if this_word[4] ~= "" then + text = text .. colorText(COLOR.HighCyan,"\tCanon origin: ") + text = text .. colorText(COLOR.HighCyan,this_word[4]) + print(text) + end + text = "" + if this_word[5] ~= "" then + text = text .. colorText(COLOR.HighPurple,"\tMeta origin: ") + text = text .. colorText(COLOR.HighPurple,this_word[5]) + print(text) + end + print("") + end end end