You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
I recently updated to argparse to version 3.0 on my program.
I have the following argument in my list (the first argument):
parser.add_argument("-p", "--printer")
.help("The name of the printer")
.default_value(std::string{});
Previously, I used to call my program like this: my.exe -p "My Printer"
Double quotes are necessary because I'm running on Windows, and printer names generally contain spaces.
This used to work perfectly before, but now I'm encountering this error: Zero positional arguments expected, did you mean -o/--output VAR
(I also have an 'output' argument declared just after this one in the list)
I noticed that argparse is splitting spaces enclosed within double quotes and attempting to interpret them as new arguments, even though they are not intended to be.
FYI, I also tested with single quotes, and I faced the same problem.
Feel free to let me know if you need further clarification or adjustments.
The text was updated successfully, but these errors were encountered:
EDIT: It might not be related to argparse but rather to PowerShell 7.4.0, which I am using.
When calling my.exe from the standard Windows terminal, I do not encounter this issue.
I am leaving the problem here for reference if someone else is facing the same issue...
Thanks for your work
Hi
I recently updated to argparse to version 3.0 on my program.
I have the following argument in my list (the first argument):
Previously, I used to call my program like this:
my.exe -p "My Printer"
Double quotes are necessary because I'm running on Windows, and printer names generally contain spaces.
This used to work perfectly before, but now I'm encountering this error:
Zero positional arguments expected, did you mean -o/--output VAR
(I also have an 'output' argument declared just after this one in the list)
I noticed that argparse is splitting spaces enclosed within double quotes and attempting to interpret them as new arguments, even though they are not intended to be.
FYI, I also tested with single quotes, and I faced the same problem.
Feel free to let me know if you need further clarification or adjustments.
The text was updated successfully, but these errors were encountered: