Message260611
Thank you for clarifying my request. Callables sound like a great solution to me!
Looks like the fallback should be called in `take_action()` if argument_values is "empty" (None?). Per default it should be transparent to an `Action` if the values are based on a fallback call. However, it might be useful to call `Action` with two additional parameters like `commandline_values` and `fallback_values` such that a (custom) action 'append_with_fallback' can be realized. Calling the fallback each time (required for `fallback_values`) makes it some kind of early called hook for argparse.
I am attaching a sketch of what might be a typical use case. I noted that a callable supplied to fallback would usually rely on informations that could be provided as `action.long_option_names` and `action.is_positional` to avoid that this logic is implemented outside of argparse again.
Please let me know I can provide any help. |
|
Date |
User |
Action |
Args |
2016-02-21 13:05:36 | quabla | set | recipients:
+ quabla, brett.cannon |
2016-02-21 13:05:36 | quabla | set | messageid: <1456059936.92.0.422715379908.issue26394@psf.upfronthosting.co.za> |
2016-02-21 13:05:36 | quabla | link | issue26394 messages |
2016-02-21 13:05:36 | quabla | create | |
|