diff --git a/alurrm/src/timurr.nim b/alurrm/src/timurr.nim new file mode 100644 index 0000000..46811f4 --- /dev/null +++ b/alurrm/src/timurr.nim @@ -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) diff --git a/alurrm/timurr.nimble b/alurrm/timurr.nimble new file mode 100644 index 0000000..b65d95a --- /dev/null +++ b/alurrm/timurr.nimble @@ -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"