diff --git a/src/argh/assembling.py b/src/argh/assembling.py index db17a6a..93c7f19 100644 --- a/src/argh/assembling.py +++ b/src/argh/assembling.py @@ -415,7 +415,10 @@ def _merge_inferred_and_declared_args( kind_declared = kinds[decl_positional] raise AssemblingError( f'argument "{func_arg_name}" declared as {kind_inferred} ' - f"(in function signature) and {kind_declared} (via decorator)" + f"(in function signature) and {kind_declared} (via decorator). " + "If you've just migrated from Argh v.0.29, please check " + "the new default NameMappingPolicy. Perhaps you need " + "to replace `func(x=1)` with `func(*, x=1)`?" ) # merge explicit argument declaration into the inferred one diff --git a/tests/test_regressions.py b/tests/test_regressions.py index eaa3a6d..6e4314b 100644 --- a/tests/test_regressions.py +++ b/tests/test_regressions.py @@ -116,7 +116,9 @@ def func(foo_bar): parser.set_default_command(func) msg = ( 'func: argument "foo_bar" declared as positional (in function ' - "signature) and optional (via decorator)" + "signature) and optional (via decorator). If you've just migrated " + "from Argh v.0.29, please check the new default NameMappingPolicy. " + "Perhaps you need to replace `func(x=1)` with `func(*, x=1)`?" ) assert excinfo.exconly().endswith(msg)