Rename CLI to bibleref
This commit is contained in:
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
author = "Jonathan Bernard"
|
author = "Jonathan Bernard"
|
||||||
description = "Simple Nim CLI wrapper around the ESV API (api.esv.org)"
|
description = "Simple Nim CLI for retrieving Biblical passages"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
srcDir = "src"
|
srcDir = "src"
|
||||||
bin = @["esv_api"]
|
bin = @["bibleref"]
|
||||||
|
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
# Nim CLI Wrapper for the ESV API
|
# Nim CLI for retrieving Biblical passages
|
||||||
# © 2023 Jonathan Bernard
|
# © 2023 Jonathan Bernard
|
||||||
|
|
||||||
## Simple command-line wrapper around the ESV API.
|
## Simple command-line tool for retrieving Biblical passages.
|
||||||
|
|
||||||
import std/[httpclient, json, logging, os, re, strutils, uri, wordwrap]
|
import std/[httpclient, json, logging, os, re, strutils, uri, wordwrap]
|
||||||
import cliutils, docopt, zero_functional
|
import cliutils, docopt, zero_functional
|
||||||
@@ -64,7 +64,7 @@ proc formatPlain(raw: string, keepVerseNumbers = true): string =
|
|||||||
|
|
||||||
when isMainModule:
|
when isMainModule:
|
||||||
const USAGE = """Usage:
|
const USAGE = """Usage:
|
||||||
esv_api <reference> [options]
|
bibleref <reference> [options]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
|
|
||||||
@@ -78,13 +78,13 @@ Options:
|
|||||||
|
|
||||||
-t, --esv-api-token <token> Provide the API token on the command line. By
|
-t, --esv-api-token <token> Provide the API token on the command line. By
|
||||||
default this will be read either from the
|
default this will be read either from the
|
||||||
.esv_api.cfg.json file or the ESV_API_TOKEN
|
.bibleref.cfg.json file or the ESV_API_TOKEN
|
||||||
envionment variable.
|
envionment variable.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
let consoleLogger = newConsoleLogger(
|
let consoleLogger = newConsoleLogger(
|
||||||
levelThreshold=lvlInfo,
|
levelThreshold=lvlInfo,
|
||||||
fmtStr="esv_api - $levelname: ")
|
fmtStr="bibleref - $levelname: ")
|
||||||
logging.addHandler(consoleLogger)
|
logging.addHandler(consoleLogger)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -96,7 +96,7 @@ Options:
|
|||||||
|
|
||||||
if args["--echo-args"]: stderr.writeLine($args)
|
if args["--echo-args"]: stderr.writeLine($args)
|
||||||
|
|
||||||
let cfgFilePath = getEnv("HOME") / ".esv_api.cfg.json"
|
let cfgFilePath = getEnv("HOME") / ".bibleref.cfg.json"
|
||||||
var cfgFileJson = newJObject()
|
var cfgFileJson = newJObject()
|
||||||
if fileExists(cfgFilePath):
|
if fileExists(cfgFilePath):
|
||||||
debug "Loading config from " & cfgFilePath
|
debug "Loading config from " & cfgFilePath
|
||||||
Reference in New Issue
Block a user