You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
854 B
26 lines
854 B
#! /usr/bin/python3
|
|
|
|
import argparse
|
|
|
|
def do_test():
|
|
print('do_test()')
|
|
|
|
parser = argparse.ArgumentParser(prog='action',description='Demonstration der Action',epilog='Ende der Hilfe')
|
|
|
|
parser.add_argument('--update',help='update Hilfe')
|
|
parser.add_argument('--dry-run',help='dry-run Hilfe')
|
|
parser.add_argument('--verbose','-v', action='count')
|
|
parser.add_argument('--true', action='store_true')
|
|
parser.add_argument('-append', action='append', nargs=1)
|
|
parser.add_argument('--false', action='store_false')
|
|
parser.add_argument('--store', action='store')
|
|
parser.add_argument('--const', action = 'store_const', const=19)
|
|
|
|
parser.add_argument('--delete', action = argparse.BooleanOptionalAction)
|
|
#parser.add_argument('--no-delete', action = argparse.BooleanOptionalAction)
|
|
|
|
|
|
args=parser.parse_args()
|
|
print(f'args={args}')
|
|
print(f'verbose={args.verbose}')
|
|
|
|
|