Skip to content
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

Duplicate in cmd line arguments are not checked (was: --verbose does not accept empty value) #1818

Closed
kelson42 opened this issue Mar 26, 2023 · 4 comments · Fixed by #1823
Closed
Assignees
Labels
Milestone

Comments

@kelson42
Copy link
Collaborator

$ mw --mwUrl="Https://de.wikipedia.org/" --verbose

....

**********

verbose should be empty or one of [info, log, warn, error, quiet].

**********

@kelson42 kelson42 added this to the 1.13.0 milestone Mar 26, 2023
@kelson42 kelson42 added the bug label Mar 26, 2023
@kelson42 kelson42 self-assigned this Mar 26, 2023
@pavel-karatsiuba
Copy link
Contributor

@kelson42 Excidently found out that you will get such an error if you use --verbose parameter more than one time.

Example to reproduce the error:
$ mw --verbose=info --adminEmail="[email protected]" --mwUrl="Https://de.wikipedia.org/" --verbose

@kelson42
Copy link
Collaborator Author

kelson42 commented Mar 29, 2023

No way to limit to one with yargs?

@pavel-karatsiuba
Copy link
Contributor

@kelson42 I see two ways to fix it:

  1. Set yargs option duplicate-arguments-array to false. In this case, if you set more than one parameter with the same name, then will be used the last one. This option will take effect for all parameters.
  2. Change the verbose sanitizing function to check this situation and show the error message: "only one --verbose parameter allowed."

@kelson42 kelson42 changed the title --verbose does not accept empty value Duplicate in cmd line arguments are not checked (was: --verbose does not accept empty value) Apr 5, 2023
@kelson42 kelson42 assigned pavel-karatsiuba and unassigned kelson42 Apr 5, 2023
@kelson42
Copy link
Collaborator Author

kelson42 commented Apr 5, 2023

@kelson42 Excidently found out that you will get such an error if you use --verbose parameter more than one time.

Example to reproduce the error: $ mw --verbose=info --adminEmail="[email protected]" --mwUrl="Https://de.wikipedia.org/" --verbose

OK, was definitly to stupid to get that error on my side. Sorry for the misleading ticket/PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants