refactor: switch to hwyl-based cligen

This commit is contained in:
Daylin Morgan 2024-09-27 10:42:17 -05:00
parent bd94042d38
commit 46d4dfd010
Signed by: daylin
GPG key ID: 950D13E9719334AD
3 changed files with 12 additions and 31 deletions

View file

@ -2,23 +2,23 @@
"version": 2, "version": 2,
"packages": { "packages": {
"cligen": { "cligen": {
"version": "1.7.0", "version": "1.7.5",
"vcsRevision": "4193f802796f15559c81c6dd56724d6f20345917", "vcsRevision": "85daafd76b0104387f50ff3f75c829b4c2804412",
"url": "https://github.com/c-blake/cligen.git", "url": "https://github.com/c-blake/cligen.git",
"downloadMethod": "git", "downloadMethod": "git",
"dependencies": [], "dependencies": [],
"checksums": { "checksums": {
"sha1": "300bd7fdb6e48d2d98e34ed0661206b50331e99c" "sha1": "f3ffe7329c8db755677d3ca377d02ff176cec8b1"
} }
}, },
"hwylterm": { "hwylterm": {
"version": "0.1.0", "version": "0.1.0",
"vcsRevision": "9afc339a9791f25010ea89a4f52204ad8eeda858", "vcsRevision": "c2bcfd1f73dda97bd3e209c89e2abfe588f0977c",
"url": "https://github.com/daylinmorgan/hwylterm", "url": "https://github.com/daylinmorgan/hwylterm",
"downloadMethod": "git", "downloadMethod": "git",
"dependencies": [], "dependencies": [],
"checksums": { "checksums": {
"sha1": "853c67ee7f789d825ec6f46c9fbae68e03e43cdb" "sha1": "1932229840c893c39acca0b50def19913678f5f0"
} }
}, },
"illwill": { "illwill": {
@ -33,12 +33,12 @@
}, },
"usu": { "usu": {
"version": "0.1.0", "version": "0.1.0",
"vcsRevision": "25574d165bb7f60900b36590bc49f3d90e47cea4", "vcsRevision": "ab2406bd5b857f44c9ebee8ed5f7287b30e089dd",
"url": "https://github.com/usu-dev/usu-nim", "url": "https://github.com/usu-dev/usu-nim",
"downloadMethod": "git", "downloadMethod": "git",
"dependencies": [], "dependencies": [],
"checksums": { "checksums": {
"sha1": "61a8c13946e3eea9dbe04a6141ed93811563026c" "sha1": "f9414616e9e7b225257b78caeb7438a52347f010"
} }
} }
}, },

View file

@ -22,27 +22,8 @@ proc getVersion(): string =
when isMainModule: when isMainModule:
import cligen import cligen, hwylterm, hwylterm/cli
clCfg.version = getVersion() clCfg.version = getVersion()
hwylCli(clCfg)
if clCfg.helpAttr.len == 0: let clUse* = $bb("$command $args\n${doc}[bold]Options[/]:\n$options")
clCfg.helpAttr = dispatch(tsm, usage = clUse, short = {"version": 'v'})
{
"cmd": "\e[1;36m",
"clDescrip": "",
"clDflVal": "\e[33m",
"clOptKeys": "\e[32m",
"clValType": "\e[31m",
"args": "\e[3m"
}.toTable
clCfg.helpAttrOff =
{
"cmd": "\e[m",
"clDescrip": "\e[m",
"clDflVal": "\e[m",
"clOptKeys": "\e[m",
"clValType": "\e[m",
"args": "\e[m"
}.toTable
dispatch(tsm, short = {"version": 'v'})

View file

@ -13,6 +13,6 @@ binDir = "bin"
requires "nim >= 2.0.0" requires "nim >= 2.0.0"
requires "illwill >= 0.4.1" requires "illwill >= 0.4.1"
requires "cligen" requires "cligen"
requires "https://github.com/daylinmorgan/hwylterm" requires "https://github.com/daylinmorgan/hwylterm#HEAD"
requires "https://github.com/usu-dev/usu-nim" requires "https://github.com/usu-dev/usu-nim"