Skip to content

Commit

Permalink
Add --library-path long option for -L
Browse files Browse the repository at this point in the history
-L is the only option without a long form.
  • Loading branch information
thaliaarchi committed Oct 30, 2024
1 parent 7399bd6 commit a81f64a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/content/manual/dev/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ sections:
Read filter from the file rather than from a command line, like
awk's -f option.
* `-L directory`:
* `-L directory` / `--library-dir directory`:
Prepend `directory` to the search list for modules. If this
option is used then no builtin search list is used. See the
Expand Down
4 changes: 2 additions & 2 deletions jq.1.prebuilt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static void usage(int code, int keep_it_short) {
" an array;\n"
" --seq parse input/output as application/json-seq;\n"
" -f, --from-file file load filter from the file;\n"
" -L directory search modules from the directory;\n"
" -L, --library-dir dir search modules from the directory;\n"
" --arg name value set $name to the string value;\n"
" --argjson name value set $name to the JSON value;\n"
" --slurpfile name file set $name to an array of JSON values read\n"
Expand Down Expand Up @@ -137,7 +137,7 @@ static int isoption(const char** text, char shortopt, const char* longopt, int i
return 1;
}
} else {
if (longopt != NULL && !strcmp(*text, longopt)) {
if (!strcmp(*text, longopt)) {
*text = NULL;
return 1;
}
Expand Down Expand Up @@ -403,7 +403,7 @@ int main(int argc, char* argv[]) {
options |= PROVIDE_NULL;
} else if (isoption(&text, 'f', "from-file", is_short)) {
options |= FROM_FILE;
} else if (isoption(&text, 'L', NULL, is_short)) {
} else if (isoption(&text, 'L', "library-dir", is_short)) {
if (jv_get_kind(lib_search_paths) == JV_KIND_NULL)
lib_search_paths = jv_array();
if (text != NULL) { // -Lname
Expand Down

0 comments on commit a81f64a

Please sign in to comment.