diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-05-31 09:11:10 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-05-31 09:12:27 +0200 |
commit | 4782a11643e31cbcc422d01c312ef8ec4fb6369c (patch) | |
tree | 3c067f3b05f5093764708f6f641de9d4cc93e27f | |
parent | reduce code duplication (diff) | |
download | libgamma-4782a11643e31cbcc422d01c312ef8ec4fb6369c.tar.gz libgamma-4782a11643e31cbcc422d01c312ef8ec4fb6369c.tar.bz2 libgamma-4782a11643e31cbcc422d01c312ef8ec4fb6369c.tar.xz |
m
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rwxr-xr-x | src/extract/libgamma-method-extract | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/extract/libgamma-method-extract b/src/extract/libgamma-method-extract index 9e76681..178ca01 100755 --- a/src/extract/libgamma-method-extract +++ b/src/extract/libgamma-method-extract @@ -112,19 +112,19 @@ def doc_struct(name): print('\n'.join(data)) +struct_map = {'--info-t' : 'libgamma_crtc_information', + '--cap-t' : 'libgamma_method_capabilities'} + if sys.argv[1] == '--list': if sys.argv[2] == '--method': list_define('LIBGAMMA_METHOD_', 'MAX', 'COUNT') elif sys.argv[2] == '--info': list_define('LIBGAMMA_CRTC_INFO_', 'COUNT') elif sys.argv[2] == '--connector': list_enum('LIBGAMMA_CONNECTOR_TYPE_', 'COUNT') elif sys.argv[2] == '--subpixel': list_enum('LIBGAMMA_SUBPIXEL_ORDER_', 'COUNT') - elif sys.argv[2] == '--info-t': list_struct('libgamma_crtc_information') - elif sys.argv[2] == '--cap-t': list_struct('libgamma_method_capabilities') + elif sys.argv[2] in struct_map: list_struct(struct_map[sys.argv[2]]) elif sys.argv[1] == '--type': - if sys.argv[2] == '--info-t': type_struct('libgamma_crtc_information') - elif sys.argv[2] == '--cap-t': type_struct('libgamma_method_capabilities') + if sys.argv[2] in struct_map: type_struct(struct_map[sys.argv[2]]) else: if sys.argv[1] in ('--method', '--info'): doc_define() elif sys.argv[1] in ('--connector', '--subpixel'): doc_enum() - elif sys.argv[1] == '--info-t': doc_struct('libgamma_crtc_information') - elif sys.argv[1] == '--cap-t': doc_struct('libgamma_method_capabilities') + elif sys.argv[1] in struct_map: doc_struct(struct_map[sys.argv[1]]) |