Python. Argparser. Removing not-needed arguments
问题 I am parsing some command-line arguments, and most of them need to be passed to a method, but not all. parser = argparse.ArgumentParser() parser.add_argument("-d", "--dir", help = "Directory name", type = str, default = "backups") parser.add_argument("-n", "--dbname", help = "Name of the database", type = str, default = "dmitrii") parser.add_argument("-p", "--password", help = "Database password", type = str, default = "1123581321") parser.add_argument("-u", "--user", help = "Database