Closed mathieulongtin closed 2 months ago
You used to be able to override the argument name with dest, but that doesn't work anymore.
dest
This was useful to allow things like --json without overriding the json module, for example.
--json
json
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
The old behavior where if dest is supplied, it overrides any guesses as to the destination argument.
Add any other context about the problem here.
Thanks, confirming, scheduled the next bugfix release.
Related, not necessarily a replacement: #222.
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 thejson
module, for example.To Reproduce
Python script:
Command line input/output:
Expected behavior
The old behavior where if
dest
is supplied, it overrides any guesses as to the destination argument.Environment
Additional context
Add any other context about the problem here.