From b0d91a1b67e4064f4bc0eac5da1182e3c5b73767 Mon Sep 17 00:00:00 2001 From: Kaushal Modi Date: Mon, 20 May 2019 21:31:24 -0400 Subject: [PATCH] Update to cligen 0.9.28 https://github.com/c-blake/cligen/blob/master/RELEASE-NOTES.md#version-0928 --- ntangle.nimble | 4 ++-- src/ntangle.nim | 25 +++++++++---------------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/ntangle.nimble b/ntangle.nimble index c7ee6ee..33f4440 100644 --- a/ntangle.nimble +++ b/ntangle.nimble @@ -1,6 +1,6 @@ # Package -version = "0.6.4" +version = "0.6.5" author = "Kaushal Modi" description = "Command-line utility for Tangling of Org mode documents" license = "MIT" @@ -9,4 +9,4 @@ bin = @["ntangle"] # Dependencies -requires "nim >= 0.19.0", "cligen >= 0.9.18" +requires "nim >= 0.19.6", "cligen >= 0.9.28" diff --git a/src/ntangle.nim b/src/ntangle.nim index c14ba27..77c6f7f 100644 --- a/src/ntangle.nim +++ b/src/ntangle.nim @@ -516,18 +516,8 @@ proc doOrgTangle(file: string) = writeFiles() echo "" -proc echoVersion() = - ## Echo the version string. - const - versionString = staticExec("git describe --tags HEAD") - echo fmt"ntangle {version_string}" - -proc ntangle(orgFilesOrDirs: seq[string], version = false) = +proc ntangle(orgFilesOrDirs: seq[string]) = ## Command-line utility for Tangling of Org mode documents - if version: - echoVersion() - quit QuitSuccess - startTime = cpuTime() try: for f1 in orgFilesOrDirs: @@ -560,10 +550,13 @@ when isMainModule: if cmdLine.len == 0: result = @["--help"] - dispatch(ntangle - , usage = "\nNAME\n ntangle - $doc\n" & + const + versionString = staticExec("git describe --tags HEAD") + # https://github.com/c-blake/cligen/blob/master/RELEASE-NOTES.md#version-0928 + clCfg.version = versionString + + dispatch(ntangle, + usage = "\nNAME\n ntangle - $doc\n" & "USAGE\n $command $args\n\n" & "OPTIONS\n$options\n" & - "URL\n " & url & "\n" - , help = { "version": "write the version to stdout" } - ) + "URL\n " & url & "\n")