Replies: 5 comments 1 reply
-
|
Hey, i think the "." in "substituted for ." probably refers to the working directory of the jq process. Does it work if you run it from the |
Beta Was this translation helpful? Give feedback.
-
This contradicts the documentation, though, which says that “the path of the including file” is what Is the documentation wrong, is the code wrong, or am I somehow misunderstanding this functionality? Thank you! |
Beta Was this translation helpful? Give feedback.
-
|
The jq 1.8 documentation (https://jqlang.org/manual/#modules) says that the RelativePathString is "relative to a directory in a search path". That is the governing documentation at this point, at least for jq 1.8. Recent versions of jaq and gojq seem to adhere to the same principle. Indeed, using your program and file layout, I've checked that the following works for jq, jaq and gojq: |
Beta Was this translation helpful? Give feedback.
-
|
@FGasper asked:
The context of this quotation is "paths in the search path":
So far as I can tell, none of jq, jaq, and gojq support this; if that is indeed the case, it will probably be quite difficult to get any of them to change. |
Beta Was this translation helpful? Give feedback.
-
|
OK, I see what you’re saying: the search paths follow different rules from the IIUC, then, a leading (or sole) That being the case, it would seem I should be able to put Is there indeed a way to add “the including file’s directory” to jq’s search path, without hard-coding a specific directory? If not, then in what context does jq actually look at the including file’s path? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a filter file
~/code/jq-filters/mongodb-mvlogs.jqthat starts with:I have a file
~/code/jq-filters/comma.jqthat contains:jq’s online docs say:
And yet, when I run jq 1.8.1:
… I get:
If I add
-L ~/code/jq-filtersto thejqinvocation, then everything works as I expect.Is the documentation wrong? Or how else can I import a module that lives in the including file’s directory?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions