Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

tl;dr - Change 841 - Add paths to Lua package.path so require works for user scripts

By the way, I have a comment. This package.prepend_path(NAME) function can be available for only personal plugins directory, right? (Because '__DIR__' can not be used in global plugins directory)
If so, I think it is better to be clear in the document, altough there is no document about this function yet.
But you're right it's not documented in the API docs.
I forgot the init.lua script's comments don't get scraped to generate the API docs. (we use a script to generate the docs)

I'll have to put that on my to-do list. (it's not trivial to fix that)


It is documented (for now) in the comments inside init.lua

The Lua documentation is a combination of docbook/wsluarm.adoc and comments scraped from the source code by make-wsluarm.pl.

There was a recent (last year) issue (15404 - Lua documentation in the WSDG lacks some details compared to the wiki but doesn't look like package.prepend_path made it.

A new issue (Enhancement request can be opened at the Wireshark Gitlab Issues page

tl;dr - Change 841 - Add paths to Lua package.path so require works for user scripts

By the way, I have a comment. This package.prepend_path(NAME) function can be available for only personal plugins directory, right? (Because '__DIR__' can not be used in global plugins directory)
If so, I think it is better to be clear in the document, altough there is no document about this function yet.
But you're right it's not documented in the API docs.
I forgot the init.lua script's comments don't get scraped to generate the API docs. (we use a script to generate the docs)

I'll have to put that on my to-do list. (it's not trivial to fix that)


Notes:

It is documented (for now) in the comments inside init.lua

The Lua documentation is a combination of docbook/wsluarm.adoc and comments scraped from the source code by make-wsluarm.pl.

There was a recent (last year) issue (15404 - Lua documentation in the WSDG lacks some details compared to the wiki but doesn't look like package.prepend_path made it.

A new issue (Enhancement request ) can be opened at the Wireshark Gitlab Issues page