-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Configuration of minimist #553
Comments
This option is already available. Just import minimist. |
Maybe I misunderstand this, but importing minimist as an external package will require that minimist is available as an external package for everyone that should run the script, or run zx with the --install parameter. If I just add this line to the script above, and does not run zx with --install, then I get an error.
The error message (as expected, I believe)
Since minimist is already imported by zx, maybe it would be possible to expose minimist to the script as a global variable in the same way as chalk, which, YAML etc.? |
I see, script out of node_modules folder. Yes, this will require -install flag. |
A few ideas on how to implement this:
|
Since we need to configure our program to accept both long and short arguments ( Lines 33 to 36 in 101b810
Alternatively, developers can import 'minimist' and parse arguments themselves, but it can result in another issue with ES Modules: #553 (comment) and #595 (comment). So Regarding the |
Good point. Let’s expose minimist. |
Any update on this? |
No update. |
It is currently difficult to use the minimist integration if you have a combination of boolean arguments and unnamed arguments.
This example script will fail if the -h option is placed before the filename parameter
A solution to this would be either:
A) A possibility to provide a configuration for minimist.
B) Expose the minimist package to the script, so that the script writer may call it directly and provide a configuration
I believe A) would be better, while B) would be easier to implement
The text was updated successfully, but these errors were encountered: