diff options
| author | Autumn <git@autumnfo.rest> | 2026-05-17 15:12:52 +0100 |
|---|---|---|
| committer | Autumn <git@autumnfo.rest> | 2026-05-17 15:12:52 +0100 |
| commit | 0d148f65e0eead4a2ea164d22ff844db428ebdb6 (patch) | |
| tree | 01b0b5d50a9ea7bdfce2278c2f4d2baba9af987b | |
| parent | 177f3214d3115a5f38e139cff3963d7fb11b439a (diff) | |
[main] added placeholder echo & service fetching utils
| -rw-r--r-- | selenepaw.lua | 16 | ||||
| -rw-r--r-- | src/actions.lua | 27 | ||||
| -rw-r--r-- | src/help.lua | 38 |
3 files changed, 75 insertions, 6 deletions
diff --git a/selenepaw.lua b/selenepaw.lua index 704ff1a..3979d93 100644 --- a/selenepaw.lua +++ b/selenepaw.lua @@ -6,8 +6,22 @@ local help = require("src/help") -- check if no args -if not args then +if #arg == 0 then help.main() + return end + +-- run associated action +local actions = require("src/actions") +local action = actions[tostring(arg[1])] + +if not action then + + help.main() + return + +end + +action() diff --git a/src/actions.lua b/src/actions.lua new file mode 100644 index 0000000..e651854 --- /dev/null +++ b/src/actions.lua @@ -0,0 +1,27 @@ +-- +-- ~~~ selenepaw actions +-- + +-- load help messages +local help = require("src/help") + +-- 0000: echo +function echo () + + help.echo() + +end + +-- 0001: fetch service +function fetchservice () + + help.fetchservice () + +end + +-- return +return { + echo = echo, + + fetchservice = fetchservice +} diff --git a/src/help.lua b/src/help.lua index 0df6c51..7f0c82d 100644 --- a/src/help.lua +++ b/src/help.lua @@ -2,17 +2,45 @@ -- ~~~ help messages -- --- main function +-- main function main () print("\nSelenePaw - a Lua-based PawSD utility.") - print("\nCurrently this util does nothing, but here are some planned features:") - print("* echo-ing a service") - print("* fetching a service's records\n") + + print("\n*> Usage:") + print("\n lua selenepaw.lua <verb name> <verb options>") + + print("\n*> Verbs:") + print("---*> 0000 - echo") + print("\n---*> 0001 - fetchservice\n") + +end + +-- 0000: echo +function echo () + + print("\nEcho (0000) - Send & receive the same data from a server.") + + print("\n*> Usage:") + print("\n lua selenepaw.lua echo <server name> <data>\n") + +end + +-- 0001: fetch service +function fetchservice () + + print("\nFetch Service (0001) - Fetch a specific service from a service.") + + print("\n*> Usage:") + print("\n lua selenepaw.lua fetchservice <server name> <service index>\n") end -- return return { - main = main + main = main, + + echo = echo, + + fetchservice = fetchservice } |
