esvsearch: extract query into variable
This commit is contained in:
parent
663cb91cd3
commit
140376887a
1 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue