diff --git a/docs/content/manual/dev/manual.yml b/docs/content/manual/dev/manual.yml index 60debde5e5..08e7c811fe 100644 --- a/docs/content/manual/dev/manual.yml +++ b/docs/content/manual/dev/manual.yml @@ -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 diff --git a/jq.1.prebuilt b/jq.1.prebuilt index d3e44cfbd1..960eba268e 100644 --- a/jq.1.prebuilt +++ b/jq.1.prebuilt @@ -1,5 +1,5 @@ . -.TH "JQ" "1" "September 2024" "" "" +.TH "JQ" "1" "October 2024" "" "" . .SH "NAME" \fBjq\fR \- Command\-line JSON processor @@ -169,7 +169,7 @@ Use the \fBapplication/json\-seq\fR MIME type scheme for separating JSON texts i Read filter from the file rather than from a command line, like awk\'s \-f option\. . .TP -\fB\-L directory\fR: +\fB\-L directory\fR / \fB\-\-library\-dir directory\fR: . .IP Prepend \fBdirectory\fR to the search list for modules\. If this option is used then no builtin search list is used\. See the section on modules below\. diff --git a/src/main.c b/src/main.c index d04d9747d7..b47868c3af 100644 --- a/src/main.c +++ b/src/main.c @@ -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" @@ -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; } @@ -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