mirror of
https://github.com/daylinmorgan/bbansi.git
synced 2024-12-21 18:40:44 -06:00
refactor: don't process help string by default
This commit is contained in:
parent
190cf82e6e
commit
5d5b459c95
1 changed files with 6 additions and 6 deletions
|
@ -141,7 +141,8 @@ when isMainModule:
|
|||
import std/[parseopt, strformat, sugar]
|
||||
const version = staticExec "git describe --tags --always --dirty=-dev"
|
||||
const longOptPad = 8
|
||||
let help = fmt"""
|
||||
proc writeHelp() =
|
||||
let help = fmt"""
|
||||
[bold]bbansi[/] \[[green]args...[/]] [[[faint]-h|-v[/]]
|
||||
|
||||
[italic]usage[/]:
|
||||
|
@ -160,6 +161,8 @@ flags:
|
|||
]:
|
||||
fmt"[yellow]-{s}[/] [green]--{l.alignLeft(longOptPad)}[/] {d}").join("\n ")
|
||||
))
|
||||
echo help
|
||||
quit(QuitSuccess)
|
||||
|
||||
proc testCard =
|
||||
for style in [
|
||||
|
@ -182,9 +185,7 @@ flags:
|
|||
echo " escaped: ", escape($bbs)
|
||||
echo ")"
|
||||
|
||||
proc writeHelp() =
|
||||
echo help
|
||||
quit(QuitSuccess)
|
||||
|
||||
proc writeVersion() =
|
||||
echo fmt"[yellow]bbansi version[/][red] ->[/] [bold]{version}[/]".bb
|
||||
quit(QuitSuccess)
|
||||
|
@ -212,8 +213,7 @@ flags:
|
|||
of cmdArgument:
|
||||
strArgs.add key
|
||||
if strArgs.len == 0:
|
||||
echo help
|
||||
quit(QuitSuccess)
|
||||
writeHelp()
|
||||
for arg in strArgs:
|
||||
let styled =
|
||||
if style != "":
|
||||
|
|
Loading…
Reference in a new issue