optional arguments:
-h, --help show this help message and exit
-u URL, --url URL The target URL to try. Default is http://cdimage.ubuntu.com
-a, --auto Runs in Automated mode, with no visible output
note that it automatically converts %(default)s to "http://cdimage.ubuntu.com" which is set as the default here:
parser.add_argument('-u', '--url', action='store', default='http://cdimage.ubuntu.com', help='The target URL to try. Default is %(default)s')
default is interpolated automatically IF you provide a default="foo" in the arg definition.
bladernr@ klaatu: ~/development/ git-workspace/ checkbox/ scripts$ ./network_check -h
usage: network_check [-h] [-u URL] [-a]
optional arguments:
http:// cdimage. ubuntu. com
-h, --help show this help message and exit
-u URL, --url URL The target URL to try. Default is
-a, --auto Runs in Automated mode, with no visible output
note that it automatically converts %(default)s to "http:// cdimage. ubuntu. com" which is set as the default here:
parser. add_argument( '-u', '--url',
action= 'store' ,
default= 'http:// cdimage. ubuntu. com',
help= 'The target URL to try. Default is %(default)s')