Skip to content

Commit

Permalink
Update to cligen 0.9.28
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushalmodi committed May 21, 2019
1 parent 49a941c commit b0d91a1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
4 changes: 2 additions & 2 deletions ntangle.nimble
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"
25 changes: 9 additions & 16 deletions src/ntangle.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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")

0 comments on commit b0d91a1

Please sign in to comment.