Rename CLI to bibleref
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
|
||||
version = "0.3.0"
|
||||
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"
|
||||
srcDir = "src"
|
||||
bin = @["esv_api"]
|
||||
bin = @["bibleref"]
|
||||
|
||||
|
||||
# Dependencies
|
||||
@@ -1,7 +1,7 @@
|
||||
# Nim CLI Wrapper for the ESV API
|
||||
# Nim CLI for retrieving Biblical passages
|
||||
# © 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 cliutils, docopt, zero_functional
|
||||
@@ -64,7 +64,7 @@ proc formatPlain(raw: string, keepVerseNumbers = true): string =
|
||||
|
||||
when isMainModule:
|
||||
const USAGE = """Usage:
|
||||
esv_api <reference> [options]
|
||||
bibleref <reference> [options]
|
||||
|
||||
Options:
|
||||
|
||||
@@ -78,13 +78,13 @@ Options:
|
||||
|
||||
-t, --esv-api-token <token> Provide the API token on the command line. By
|
||||
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.
|
||||
"""
|
||||
|
||||
let consoleLogger = newConsoleLogger(
|
||||
levelThreshold=lvlInfo,
|
||||
fmtStr="esv_api - $levelname: ")
|
||||
fmtStr="bibleref - $levelname: ")
|
||||
logging.addHandler(consoleLogger)
|
||||
|
||||
try:
|
||||
@@ -96,7 +96,7 @@ Options:
|
||||
|
||||
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()
|
||||
if fileExists(cfgFilePath):
|
||||
debug "Loading config from " & cfgFilePath
|
||||
Reference in New Issue
Block a user