]> granicus.if.org Git - graphviz/commitdiff
Add --short option
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sun, 7 Jun 2020 16:05:39 +0000 (18:05 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sat, 13 Jun 2020 06:16:54 +0000 (08:16 +0200)
ci/generate-configuration-table.py

index f47cbc2596cb7c729b81d2005de720f62439e468..fe418d5e523410a2abe16bdc37b91ccc11a6efad 100755 (executable)
@@ -19,6 +19,9 @@ def main():
     parser.add_option('-v', '--verbose', action='store_true',
                       dest='verbose', default=False,
                       help='Log info about what is going on')
+    parser.add_option('-s', '--short', action='store_true',
+                      dest='short', default=False,
+                      help='Output only Yes or No')
     parser.add_option('--output-format', action='store',
                       dest='output_format', default='JSON',
                       help='Set output format. Supported formats are ' +
@@ -56,6 +59,9 @@ def main():
                         component_names[section_name] = []
                 else:
                     component_name, component_value = item;
+                    short_value = re.sub('(Yes|No).*', '\\1', component_value)
+                    if opts.short:
+                        component_value = short_value
                     if component_name not in table[section_name]:
                         table[section_name][component_name] = {};
                         component_names[section_name].append(component_name)