more updates for hwylcli transition

This commit is contained in:
Daylin Morgan 2024-11-10 12:48:23 -06:00
parent 1a8fc2dfb7
commit b0a5545ebc
Signed by: daylin
GPG key ID: 950D13E9719334AD
3 changed files with 28 additions and 59 deletions

View file

@ -8,4 +8,4 @@ binDir = "bin"
requires "nim >= 2.0.0" requires "nim >= 2.0.0"
requires "https://github.com/daylinmorgan/hwylterm#dfd9a7d" requires "https://github.com/daylinmorgan/hwylterm#e8e090c"

View file

@ -3,12 +3,12 @@
"packages": { "packages": {
"hwylterm": { "hwylterm": {
"version": "0.1.0", "version": "0.1.0",
"vcsRevision": "dfd9a7d98d345510c9d248670b7e80f7501d1a5a", "vcsRevision": "e8e090c5b76bc555231bda536193df6f92a54db2",
"url": "https://github.com/daylinmorgan/hwylterm", "url": "https://github.com/daylinmorgan/hwylterm",
"downloadMethod": "git", "downloadMethod": "git",
"dependencies": [], "dependencies": [],
"checksums": { "checksums": {
"sha1": "7ed514f09d1f74f725c866ddb3cfba19cc8b3e42" "sha1": "925aad3ce660979de7cdb2f58a31dc7ac693e34d"
} }
} }
}, },

View file

@ -58,14 +58,6 @@ proc release(
noConfig: bool = false, noConfig: bool = false,
verbose: bool = false, verbose: bool = false,
) = ) =
## generate release assets for n>=1 targets
##
## format argument:
## format is a template string used for each target directory
## available fields are name, version, target
## default: ${name}-v${verison}-${target}
##
## if name or version are not specified they will be inferred from the local .nimble file
zigExists() zigExists()
let cfg = let cfg =
@ -119,17 +111,22 @@ proc release(
termErrQuit &"exited with code {errCode} see above for error" termErrQuit &"exited with code {errCode} see above for error"
when isMainModule: when isMainModule:
# import cligen
# TODO: swap for hwylterm/hwylcli
import hwylterm/hwylcli import hwylterm/hwylcli
# hwylCli(clCfg) const vsn{.strDefine.} = staticExec "git describe --tags --always HEAD"
# let clUse* = $bb("$command $args\n${doc}[bold]Options[/]:\n$options")
const vsn = staticExec "git describe --tags --always HEAD"
hwylCli: hwylCli:
name "forge" name "forge"
... "cross-compile nim binaries with [b yellow]zig[/]"
V vsn V vsn
flags:
[shared]
`dry-run`:
T bool
? "show command instead of executing"
- n
nimble:
T bool
? "use nimble as base command for compiling"
subcommands: subcommands:
--- targets --- targets
... "show available targets" ... "show available targets"
@ -138,13 +135,7 @@ when isMainModule:
--- cc --- cc
... "compile with zig cc" ... "compile with zig cc"
flags: flags:
`dry-run`: ^[shared]
T bool
? "show command instead of executing"
- n
nimble:
T bool
? "use nimble as base command for compiling"
target: target:
? "target triple" ? "target triple"
- t - t
@ -163,6 +154,7 @@ when isMainModule:
if name or version are not specified they will be inferred from the local .nimble file if name or version are not specified they will be inferred from the local .nimble file
""" """
flags: flags:
^[shared]
verbose: verbose:
T bool T bool
? "enable verbose" ? "enable verbose"
@ -176,15 +168,8 @@ when isMainModule:
T seq[string] T seq[string]
? "set bin, may be repeated" ? "set bin, may be repeated"
* @[] * @[]
`dry-run`:
T bool
? "show command instead of executing"
- n
format: format:
? "set format, see help above" ? "set format, see help above"
nimble:
T bool
? "use nimble as base command for compiling"
`config-file`: `config-file`:
? "path to config" ? "path to config"
* ".forge.cfg" * ".forge.cfg"
@ -203,33 +188,17 @@ when isMainModule:
* "" * ""
run: run:
release( release(
target,# seq[string] = @[], target,
bin, # seq[string] = @[], bin,
args,# seq[string], args,
outdir,# string = "dist", outdir,
format,# string = "", format,
name,# string = "", name,
version,# string = "", version,
`dry-run`,# bool = false, `dry-run`,
nimble,# bool = false, nimble,
`config-file`,# string = ".forge.cfg", `config-file`,
`no-config`,# bool = false, `no-config`,
verbose,# bool = false, verbose,
) )
# [
# release,
# usage = clUse,
# help = {
# "target": "set target, may be repeated",
# "bin": "set bin, may be repeated",
# "dryrun": "show command instead of executing",
# "format": "set format, see help above",
# "nimble": "use nimble as base command for compiling",
# "config-file": "path to config",
# "no-config": "ignore config file",
# },
# short = {"verbose": 'V'},
# ],
# )