From 140376887a7c6dfcbd3b2db16b82802e361758fb Mon Sep 17 00:00:00 2001 From: Jeremy Baxter Date: Thu, 8 Aug 2024 16:57:47 +1200 Subject: [PATCH] esvsearch: extract query into variable --- esvsearch.d | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/esvsearch.d b/esvsearch.d index d0dbcbc..24085ae 100644 --- a/esvsearch.d +++ b/esvsearch.d @@ -44,6 +44,7 @@ main(string[] args) ESVApi esv; string apiKey; string configPath; + string query; sharedInit(args); @@ -73,6 +74,8 @@ main(string[] args) return 1; } + query = args[1].dup(); + /* determine configuration file: options take first priority, * then environment variables, and then the default path */ configPath = environment.get(cf.configEnv, cf.configPath) @@ -100,7 +103,7 @@ main(string[] args) esv = ESVApi(apiKey); try - writeln(esv.searchFormat(args[1])); + writeln(esv.searchFormat(query)); catch (ESVException) die("no results"); catch (CurlException e)