Add --library-path long option for -L
-L is the only option without a long form.
This commit is contained in:
1 parent
ff4acba769
commit
0558e77e8c
3 files changed
+6
-6
No files matched your search
@@ -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-path directory`:
|
||||
|
||||
Prepend `directory` to the search list for modules. If this
|
||||
option is used then no builtin search list is used. See the
|
||||
|
||||
Generated
+2
-2
@@ -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\-path 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\.
|
||||
|
||||
+3
-3
@@ -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-path 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-path", is_short)) {
|
||||
if (jv_get_kind(lib_search_paths) == JV_KIND_NULL)
|
||||
lib_search_paths = jv_array();
|
||||
if (text != NULL) { // -Lname
|
||||
|
||||
Reference in new issue
Block a user