mirror of
https://github.com/daylinmorgan/bbansi.git
synced 2024-11-21 17:00:44 -06:00
refactor: move debug to mainmodule
This commit is contained in:
parent
a5f7ca90cd
commit
f4594287d1
1 changed files with 14 additions and 7 deletions
|
@ -13,13 +13,6 @@ type
|
|||
plain: string
|
||||
spans: seq[BbSpan]
|
||||
|
||||
proc debug(bbs: BbString): string =
|
||||
echo "bbString("
|
||||
echo " raw: ", bbs.raw
|
||||
echo " plain: ", bbs.plain
|
||||
echo " spans: ", bbs.spans
|
||||
echo ")"
|
||||
|
||||
proc `&`*(x: BbString, y: string): BbString =
|
||||
result = x
|
||||
result.raw &= y
|
||||
|
@ -129,6 +122,11 @@ proc `&`*(x: BbString, y: BbString): Bbstring =
|
|||
# there is probably a more efficient way to do this
|
||||
bb(x.raw & y.raw)
|
||||
|
||||
proc bbEcho*(args: varargs[string, `$`]) {.sideEffect.} =
|
||||
for x in args:
|
||||
stdout.write(x.bb)
|
||||
stdout.write('\n')
|
||||
stdout.flushFile
|
||||
|
||||
# ---- cli
|
||||
when isMainModule:
|
||||
|
@ -154,6 +152,15 @@ flags:
|
|||
]:
|
||||
&"[yellow]-{s}[/] [green]--{l.alignLeft(longOptPad)}[/] {d}").join("\n ")
|
||||
))
|
||||
|
||||
proc debug(bbs: BbString): string =
|
||||
echo "bbString("
|
||||
echo " raw: ", bbs.raw
|
||||
echo " plain: ", bbs.plain
|
||||
echo " spans: ", bbs.spans
|
||||
echo " escaped: ", escape($bbs)
|
||||
echo ")"
|
||||
|
||||
proc writeHelp() =
|
||||
echo help
|
||||
quit(QuitSuccess)
|
||||
|
|
Loading…
Reference in a new issue