added timurr WIP
This commit is contained in:
parent
6d9f5a8da3
commit
d8b0a159b8
2 changed files with 45 additions and 0 deletions
31
alurrm/src/timurr.nim
Normal file
31
alurrm/src/timurr.nim
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
import ../../globurrl
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
const DURATION_FMT="HH:mm:ss"
|
||||||
|
|
||||||
|
var parser = newParser:
|
||||||
|
flag "-s", "--show", help="Show current timers"
|
||||||
|
flag "-a", "--add", help="Add a new timer, requires -d,--duration"
|
||||||
|
option "-d", "--duration", help="Duration in HH:mm:ss format", default=some("")
|
||||||
|
|
||||||
|
proc show_timurr() =
|
||||||
|
echo "Hello"
|
||||||
|
|
||||||
|
when isMainModule:
|
||||||
|
echo("This is still a work in progress")
|
||||||
|
try:
|
||||||
|
var opts = parser.parse()
|
||||||
|
if opts.show:
|
||||||
|
show_timurr()
|
||||||
|
elif opts.add:
|
||||||
|
if opts.duration != "":
|
||||||
|
echo "hi"
|
||||||
|
else:
|
||||||
|
stderr.writeLine "Cannot add (-a) without durations (-d)"
|
||||||
|
except ShortCircuit as e:
|
||||||
|
if e.flag == "argparse_help":
|
||||||
|
echo parser.help
|
||||||
|
quit(1)
|
||||||
|
except UsageError:
|
||||||
|
stderr.writeLine getCurrentExceptionMsg()
|
||||||
|
quit(1)
|
14
alurrm/timurr.nimble
Normal file
14
alurrm/timurr.nimble
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# Package
|
||||||
|
|
||||||
|
version = "0.1.0"
|
||||||
|
author = "Paul Wilde"
|
||||||
|
description = "A timer/alarm tool"
|
||||||
|
license = "GPL-3.0-or-later"
|
||||||
|
srcDir = "src"
|
||||||
|
bin = @["timurr"]
|
||||||
|
|
||||||
|
|
||||||
|
# Dependencies
|
||||||
|
|
||||||
|
requires "nim >= 1.6.6"
|
||||||
|
requires "argparse"
|
Loading…
Reference in a new issue