When the transfer name begins with a dash and is passed as a positional argument, argparse.ArgumentParser tries to treat it as an argument name rather than a value
This is not a problem for:
scripts that just use argv to process the arguments
scripts that use named arguments with an equals (e.g. ./myScript.py --name="-mysip")
However, it is a problem for:
scripts that use ArgumentParser and named arguments without an equals (e.g. ./myScript --name "-mysip")
scripts that use ArgumentParser and positional arguments
I've run database queries to identify the commands that needed changing, and also successfully run a test transfer beginning with a dash.
This fixes https://github.com/JiscRDSS/rdss-archivematica/issues/98
When the transfer name begins with a dash and is passed as a positional argument,
argparse.ArgumentParser
tries to treat it as an argument name rather than a valueThis is not a problem for:
argv
to process the arguments./myScript.py --name="-mysip"
)However, it is a problem for:
ArgumentParser
and named arguments without an equals (e.g../myScript --name "-mysip"
)ArgumentParser
and positional argumentsI've run database queries to identify the commands that needed changing, and also successfully run a test transfer beginning with a dash.