Skip to content

CLI program argument parsing fails if colon in program args #75

Closed
@jayvdb

Description

@jayvdb

When a program is invoked with args containing a colon (:), the arg parser sets endpoint_index to be the program arg containing the colon, and in my case that resulted in this backtrace:

$ jgo mvxcvi:cljstyle fix C:/path/to/file
INFO 2022-07-14 16:01:28,175: First time start-up may be slow. Downloaded dependencies will be cached for shorter start-up times in subsequent executions.
Traceback (most recent call last):
  File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Python310\Scripts\jgo.exe\__main__.py", line 7, in <module>
  File "C:\Python310\lib\site-packages\jgo\jgo.py", line 406, in _jgo_main
    completed_process = run(parser, argv=argv, stdout=stdout, stderr=stderr)
  File "C:\Python310\lib\site-packages\jgo\jgo.py", line 769, in run
    primary_endpoint, workspace = resolve_dependencies(
  File "C:\Python310\lib\site-packages\jgo\jgo.py", line 577, in resolve_dependencies
    os.makedirs(workspace, exist_ok=True)
  File "C:\Python310\lib\os.py", line 215, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "C:\Python310\lib\os.py", line 225, in makedirs
    mkdir(name, mode)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:/path/to/file\\RELEASE'

Presumably that backtrace indicates there is a need for resolve_dependencies to better handle strange input, but the more pressing problem is that the arg parsing needs to be improved so that there are no constraints on the program args which jgo should ignore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions