Option argument cannot begin with an hyphen #141

Closed
opened 2021-11-20 15:20:07 +00:00 by ungleich-gitea · 2 comments

Created by: antifob

The following fails:

__line /tmp/xx --regex '-x' --line 'x'
usage: __line [--state STATE] [--regex REGEX] [--file FILE] [--line LINE]
              object_id
__line: error: argument --regex: expected one argument

Regards

*Created by: antifob* The following fails: ``` __line /tmp/xx --regex '-x' --line 'x' ``` ``` usage: __line [--state STATE] [--regex REGEX] [--file FILE] [--line LINE] object_id __line: error: argument --regex: expected one argument ``` Regards
Author
Owner

Created by: antifob

Thanks, @darko-poljak, for the pointer. it still fails so I PR'ed a fix.

For those interested: upstream argparse issue at https://bugs.python.org/issue9334

edit: typo

*Created by: antifob* Thanks, @darko-poljak, for the pointer. it still fails so I PR'ed a fix. For those interested: upstream argparse issue at https://bugs.python.org/issue9334 edit: typo
Author
Owner

Created by: darko-poljak

@uqam-fob Try this instead:

__line /tmp/xx --regex='-x' --line 'x'

The above that fails is a known failure/bug with argparse module which is used by cdist.
Please send your feedback.

*Created by: darko-poljak* @uqam-fob Try this instead: <pre> __line /tmp/xx --regex='-x' --line 'x' </pre> The above that fails is a known failure/bug with argparse module which is used by cdist. Please send your feedback.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ungleich-public/cdist#141
No description provided.