@contextmanager<EOL>def augment_usage_errors(ctx, param=None):
try:<EOL><INDENT>yield<EOL><DEDENT>except BadParameter as e:<EOL><INDENT>if e.ctx is None:<EOL><INDENT>e.ctx = ctx<EOL><DEDENT>if param is not None and e.param is None:<EOL><INDENT>e.param = param<EOL><DEDENT>raise<EOL><DEDENT>except UsageError as e:<EOL><INDENT>if e.ctx is None:<EOL><INDENT>e.ctx = ctx<EOL><DEDENT>raise<EOL><DEDENT>
Context manager that attaches extra information to exceptions that
    fly.