neithere / argh

An argparse wrapper that doesn't make you say "argh" each time you deal with it.
http://argh.rtfd.org
GNU Lesser General Public License v3.0
369 stars 55 forks source link

use kwargs from different function? #151

Closed proximous closed 1 year ago

proximous commented 2 years ago

I have a wrapper function:

def wrapper(**kwargs):
   try:
      myfunc(**kwargs)
   except:
      pass

and my desired function:

def myfunc(a="1", b="2"):
   print(a)
   print(b)

I would like to do something like:

argh.dispatch_command(wrapper)

How would I tell argh to call wrapper() but get the kwargs from myfunc()? Is this possible?

neithere commented 1 year ago

I believe this can be resolved as described in #111. Please reopen if this doesn't help.