Bug: CLI Argument parsing typos invokes other validates
See original GitHub issueExpected Behavior
Not to validate the integrity by default via CLI command e.g.)
npx lockfile-lint --validate-https -validate-package-names --validate-integrity --path yarn.lock
Current Behavior
npx lockfile-lint --validate-https -validate-package-names --validate-integrity false --path yarn.lock
Always seems to validate the integrity is sha512
Possible Solution
Steps to Reproduce (for bugs)
- Run
npx lockfile-lint --validate-https -validate-package-names --validate-integrity --path yarn.lock
with a lockfile that is using sha1 integrity
Have also tried passing false as an aargument to --validate-integrity
which also did not work
Context
Your Environment
- Library Version used: 4.9.5
- Node.js version (e.g. Node.js 5.4): 16
- Operating System and version (desktop or mobile): MacOS 12.6
Issue Analytics
- State:
- Created a year ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Yet another command line argument parser: bpaf 0.5.2 : r/rust
Hi, I want to share my command line argument parser library: ... friendly error messages when parsing fails: suggested names with typos, ...
Read more >Getting Real with Command Line Arguments and go-flags
One is that the parser is implicitly the top-level command, and subcommands are directly attached to it (via the AddCommand calls). Another thing...
Read more >docopt creates beautiful command-line interfaces - GitHub
The option parser is generated based on the docstring above that is passed to docopt function. docopt parses the usage pattern ( "Usage:...
Read more >jsonargparse — jsonargparse documentation
This package is an extension to python's argparse which simplifies parsing of configuration options from command line arguments, json configuration files ...
Read more >argparse tutorial - manpages.ubuntu!
Parsing command line arguments :parse([args]) method of the Parser class ... failed") Usage: script.lua [-h] Error: manual argument validation failed Help ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yep correct…well kind of… obviously there was a typo with missing
-
and i needed to turn that off anyway because of the use of artifactory where i am at… but as @yoavain found there was still an issue with the fact it was validating the integrity with the typo which was a bit weird…anyway thanks to you both for looking at it…
I think this is a general issue. I believe the bug is in the following logic:
The first line means that if a boolean parameter exists, the validator is added, regardless of the value true/false. (The commandValue is passed as values to the validator, but the validator will be executed)
If I have time, I’ll try to open a PR during the weekend