Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Setting the argument name with dest is ignored #224

@mathieulongtin

Description

@mathieulongtin

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.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions