import argparse
import sys

vars = {"toto", "tata", "titi"}

parser = argparse.ArgumentParser()

parser.add_argument(
    '-t', '--target',
    nargs='+',
    choices=vars,
    help="Specify from 1 to 3 values from: toto, tata, titi.",
    required=True
)

# Execute parsing
args = parser.parse_args()

# Check if arguments are more than expected
if len(args.target) > 3:
    print("Error: can be used **at max 3** values from 'toto', 'tata' and 'titi'.", file=sys.stderr)
    sys.exit(1)

print("You've written:", args.target)
