Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Setting the argument name with dest is ignored #224

Closed
mathieulongtin opened this issue Feb 15, 2024 · 2 comments
Closed

Setting the argument name with dest is ignored #224

mathieulongtin opened this issue Feb 15, 2024 · 2 comments
Assignees
Labels
Milestone

Comments

@mathieulongtin
Copy link

Summary

You used to be able to override the argument name with dest, but that doesn't work anymore.

This was useful to allow things like --json without overriding the json module, for example.

To Reproduce

Python script:

import argh

@argh.arg("-l", dest="list_files")
def somefunc(list_files=False):
  pass

Command line input/output:

$ my-script.py ...
argh.assembling.ArgumentNameMappingError: somefunc: argument -l does not fit function signature: -l/--list-files

Expected behavior

The old behavior where if dest is supplied, it overrides any guesses as to the destination argument.

Environment

  • OS: Ubuntu
  • Python version: 3.10
  • Argh version: 0.31.2

Additional context

Add any other context about the problem here.

@neithere neithere added this to the 0.31.3 milestone Feb 18, 2024
@neithere
Copy link
Owner

Thanks, confirming, scheduled the next bugfix release.

@neithere
Copy link
Owner

Related, not necessarily a replacement: #222.

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

No branches or pull requests

2 participants