This commit is contained in:
Paul Wilde 2022-10-18 12:19:48 +01:00
commit ae14fa08dd
2 changed files with 45 additions and 0 deletions

31
alurrm/src/timurr.nim Normal file
View 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
View 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"