mirror of
https://github.com/daylinmorgan/bbansi.git
synced 2024-11-21 17:00: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]
|
import std/[parseopt, strformat, sugar]
|
||||||
const version = staticExec "git describe --tags --always --dirty=-dev"
|
const version = staticExec "git describe --tags --always --dirty=-dev"
|
||||||
const longOptPad = 8
|
const longOptPad = 8
|
||||||
let help = fmt"""
|
proc writeHelp() =
|
||||||
|
let help = fmt"""
|
||||||
[bold]bbansi[/] \[[green]args...[/]] [[[faint]-h|-v[/]]
|
[bold]bbansi[/] \[[green]args...[/]] [[[faint]-h|-v[/]]
|
||||||
|
|
||||||
[italic]usage[/]:
|
[italic]usage[/]:
|
||||||
|
@ -160,6 +161,8 @@ flags:
|
||||||
]:
|
]:
|
||||||
fmt"[yellow]-{s}[/] [green]--{l.alignLeft(longOptPad)}[/] {d}").join("\n ")
|
fmt"[yellow]-{s}[/] [green]--{l.alignLeft(longOptPad)}[/] {d}").join("\n ")
|
||||||
))
|
))
|
||||||
|
echo help
|
||||||
|
quit(QuitSuccess)
|
||||||
|
|
||||||
proc testCard =
|
proc testCard =
|
||||||
for style in [
|
for style in [
|
||||||
|
@ -182,9 +185,7 @@ flags:
|
||||||
echo " escaped: ", escape($bbs)
|
echo " escaped: ", escape($bbs)
|
||||||
echo ")"
|
echo ")"
|
||||||
|
|
||||||
proc writeHelp() =
|
|
||||||
echo help
|
|
||||||
quit(QuitSuccess)
|
|
||||||
proc writeVersion() =
|
proc writeVersion() =
|
||||||
echo fmt"[yellow]bbansi version[/][red] ->[/] [bold]{version}[/]".bb
|
echo fmt"[yellow]bbansi version[/][red] ->[/] [bold]{version}[/]".bb
|
||||||
quit(QuitSuccess)
|
quit(QuitSuccess)
|
||||||
|
@ -212,8 +213,7 @@ flags:
|
||||||
of cmdArgument:
|
of cmdArgument:
|
||||||
strArgs.add key
|
strArgs.add key
|
||||||
if strArgs.len == 0:
|
if strArgs.len == 0:
|
||||||
echo help
|
writeHelp()
|
||||||
quit(QuitSuccess)
|
|
||||||
for arg in strArgs:
|
for arg in strArgs:
|
||||||
let styled =
|
let styled =
|
||||||
if style != "":
|
if style != "":
|
||||||
|
|
Loading…
Reference in a new issue