1 #!/usr/bin/env python3 |
1 #!/usr/bin/env python3 |
2 from sys import version_info |
2 from sys import version_info |
3 if version_info < (3, 4): |
3 if version_info < (3, 4): |
4 raise RuntimeError('Python 3.4 or newer required') |
4 raise RuntimeError('Python 3.4 or newer required') |
|
5 |
|
6 appname = 'ldcheck' |
|
7 version = (0, 0, 9999) |
|
8 version_string = str.join('.', map(str, version)) |
5 |
9 |
6 from colours import load_colours |
10 from colours import load_colours |
7 from geometry import * |
11 from geometry import * |
8 from pathlib import Path |
12 from pathlib import Path |
9 import linetypes |
13 import linetypes |
128 ) |
132 ) |
129 parser.add_argument('--color', |
133 parser.add_argument('--color', |
130 action = 'store_true', |
134 action = 'store_true', |
131 help = 'use colors' |
135 help = 'use colors' |
132 ) |
136 ) |
|
137 parser.add_argument('-v', '--version', |
|
138 action = 'version', |
|
139 version = str.format('{appname} {version}', |
|
140 appname = appname, |
|
141 version = version_string, |
|
142 ), |
|
143 ) |
133 args = parser.parse_args() |
144 args = parser.parse_args() |
134 config = load_config('ldcheck.cfg') |
145 config = load_config('ldcheck.cfg') |
135 for ldconfig_ldr_path in find_ldconfig_ldr_paths(config): |
146 for ldconfig_ldr_path in find_ldconfig_ldr_paths(config): |
136 with ldconfig_ldr_path.open() as ldconfig_ldr: |
147 with ldconfig_ldr_path.open() as ldconfig_ldr: |
137 load_colours(ldconfig_ldr) |
148 load_colours(ldconfig_ldr) |