Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix cd rip --max-retries option handling #460

Merged
merged 1 commit into from
Jan 30, 2020
Merged

Fix cd rip --max-retries option handling #460

merged 1 commit into from
Jan 30, 2020

Conversation

kevinoid
Copy link
Contributor

9db3aa9 introduced the -r/--max-retries option, but passed 'r' to argparse.ArgumentParser.add_argument instead of '-r' which causes:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File ".../whipper/command/main.py", line 48, in main
    cmd = Whipper(sys.argv[1:], os.path.basename(sys.argv[0]), None)
  File ".../whipper/command/basecommand.py", line 117, in __init__
    self.options
  File ".../whipper/command/basecommand.py", line 117, in __init__
    self.options
  File ".../whipper/command/basecommand.py", line 60, in __init__
    self.add_arguments()
  File ".../whipper/command/cd.py", line 308, in add_arguments
    default=DEFAULT_MAX_RETRIES)
  File "/usr/lib/python3.7/argparse.py", line 1354, in add_argument
    kwargs = self._get_optional_kwargs(*args, **kwargs)
  File "/usr/lib/python3.7/argparse.py", line 1485, in _get_optional_kwargs
    raise ValueError(msg % args)
ValueError: invalid option string 'r': must start with a character '-'

for any arguments passed to whipper cd rip. This PR fixes it.

Thanks for considering,
Kevin

9db3aa9 introduced the -r/--max-retries option, but passed `'r'` to
`argparse.ArgumentParser.add_argument` instead of `'-r'` which causes:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File ".../whipper/command/main.py", line 48, in main
        cmd = Whipper(sys.argv[1:], os.path.basename(sys.argv[0]), None)
      File ".../whipper/command/basecommand.py", line 117, in __init__
        self.options
      File ".../whipper/command/basecommand.py", line 117, in __init__
        self.options
      File ".../whipper/command/basecommand.py", line 60, in __init__
        self.add_arguments()
      File ".../whipper/command/cd.py", line 308, in add_arguments
        default=DEFAULT_MAX_RETRIES)
      File "/usr/lib/python3.7/argparse.py", line 1354, in add_argument
        kwargs = self._get_optional_kwargs(*args, **kwargs)
      File "/usr/lib/python3.7/argparse.py", line 1485, in _get_optional_kwargs
        raise ValueError(msg % args)
    ValueError: invalid option string 'r': must start with a character '-'

for any arguments passed to `whipper cd rip`.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
@JoeLametta
Copy link
Collaborator

Merged, thanks for reporting this issue and opening a pull request!

@JoeLametta JoeLametta merged commit 8428b69 into whipper-team:develop Jan 30, 2020
@kevinoid
Copy link
Contributor Author

Sure thing. Thanks for reviewing and merging so quickly!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants