Skip to content

-c ~= becomes C:\Users\= on Windows #236

Description

@GaidaiIgor

Describe the bug

Attempting to run pigar generate -c "~=" in powershell on windows results in the following error:

Error: Invalid value for '-c' / '--comparison-specifier': 'C:\Users\=' is not one of '==', '~=', '>=', '>', '-'.

So ~ is expanded into C:\Users\, which prevents ~= from being recognized as a valid option for -c.
As far as I can tell, this is not happening on powershell's side since running things like
python -c "import sys; print(sys.argv)" "~=" still prints ['-c', '~=']

Not sure if it breaks anything else in the code but changing cli() on line 553 in __main__.py to
cli.main(windows_expand_args=False) fixes this particular issue for me.

Context (Environment)

  • OS: Windows 11
  • Version of Python: 3.14
  • Version of pigar: 2.2.0

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions