Note that the document was a little confusing.
Python has an argparse module that can conveniently handle startup arguments.
There are the following two types of arguments handled by argparse.
--Position arguments (such as infile1) --Optional arguments (such as -f and --bar) (= flag) (It is written in official document argparse "name or flags")
You can specify what arguments you can specify with the ʻadd_argument ()` method, but because positional arguments are required
argument.add_argument(
'infile1',
required=True,
help='input file'
)
If you write like this, you will get an error "'required' is an invalid argument for positionals
"and you will not be able to execute it.
Required
"can be specified only as an optional argumentSince " required
"is specified for an optional argument, an error will occur if it is specified for a positional argument.
Originally, the positional argument is required, so if you delete the corresponding option "required = True", the expected behavior will be obtained.