Closed vipulgupta2048 closed 1 year ago
Hi @vipulgupta2048, thank you for raising this issue. I agree that the issue can be more descriptive. Maybe we even style the error message in red color or such?
Let me look into what sort of fix should be applied to help you create a Pull Request to fix this.
Ok so if we switch the order of the arguments definition so that the long form text becomes the key of the object and the alias becomes the short, then when yargs
(the command line args parser lib) will show the long form.
The change required is kind of like this:
diff --git a/packages/lockfile-lint/src/config.js b/packages/lockfile-lint/src/config.js
index fe619d4..8f43f2d 100644
--- a/packages/lockfile-lint/src/config.js
+++ b/packages/lockfile-lint/src/config.js
@@ -29,8 +29,8 @@ module.exports = (argv, exitProcess = false, searchFrom = process.cwd()) => {
.help('help')
.alias('help', 'h')
.options({
- p: {
- alias: ['path'],
+ 'path': {
+ alias: ['p'],
type: 'string',
describe: 'path to the lockfile',
demandOption: true
Do you want to submit a pull request that fixes this? don't forget to update the tests too.
Is your feature request related to a problem? Please describe.
Using this command
lockfile-lint --type npm --allowed-hosts npm github.com --allowed-schemes 'https:' 'git+https:'
resulted in errorDescribe the solution you'd like
https://github.com/lirantal/lockfile-lint/blob/f1ae11ef18b1229360d7bb835cc1d1c931087211/packages/lockfile-lint/__tests__/config.test.js#L39-L45
I think what can be improved is the message which can be: This error is shown when the required parameter (path) is missing. I am already providing parameters, it's just the path parameter that is missing.
Missing required argument: p
, how about we showMissing required argument: path
Mentioning just
p
probably was confusing.I am happy to help create a PR but I can't find where the error for this is thrown. Let me know what you feel about this issue and I can create a PR. Thanks!