argparse javascript example
Example 1: python argparse file argument
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('file', type=argparse.FileType('r'))
args = parser.parse_args()
print(args.file.readlines())
Example 2: arg parse array argument
parser.add_argument("--list", nargs="+", default=["a", "b"])
SHELL
$ python3 example.py --list a b c
# List would look like ['a','b','c']