tsm/src/tsm.nim

30 lines
776 B
Nim
Raw Normal View History

2023-09-21 13:43:14 -05:00
import std/[tables]
2023-09-05 13:36:33 -05:00
2023-09-21 13:43:14 -05:00
import tui, project, utils
2023-09-05 17:02:08 -05:00
2023-09-05 13:36:33 -05:00
proc tsm() =
let
project = selectProject()
selected = project.name
2023-09-21 13:43:14 -05:00
if selected notin tmux.sessions:
tmux.new project.name, project.location
2023-09-05 13:36:33 -05:00
else:
2023-09-21 13:43:14 -05:00
tmux.attach project.name
2023-09-05 13:36:33 -05:00
when isMainModule:
import cligen
2023-09-21 13:43:14 -05:00
const vsn = staticExec "git describe --tags --always HEAD --match 'v*'"
2023-09-05 13:36:33 -05:00
clCfg.version = vsn
if clCfg.helpAttr.len == 0:
clCfg.helpAttr = {"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'},
)