Code Duplication    Length = 14-15 lines in 2 locations

tools/wandbox/iuwandbox.py 2 locations

@@ 683-697 (lines=15) @@
680
                        if s['default']:
681
                            print(s['name'] + ' (default)')
682
                        else:
683
                            print(s['name'])
684
                    elif 'options' in s:
685
                        print(s['default'] + ' (default)')
686
                        for o in s['options']:
687
                            print('  ' + o['name'])
688
689
690
def get_options(compiler):
691
    r = wandbox_get_compilerlist()
692
    opt = []
693
    for d in r:
694
        if d['name'] == compiler:
695
            if 'switches' in d:
696
                switches = d['switches']
697
                for s in switches:
698
                    if 'name' in s:
699
                        opt.append(s['name'])
700
                    elif 'options' in s:
@@ 701-714 (lines=14) @@
698
                    if 'name' in s:
699
                        opt.append(s['name'])
700
                    elif 'options' in s:
701
                        opt.append(s['default'])
702
                        for o in s['options']:
703
                            opt.append(o['name'])
704
    return opt
705
706
707
# get default options
708
def get_default_options(compiler):
709
    r = wandbox_get_compilerlist()
710
    opt = []
711
    for d in r:
712
        if d['name'] == compiler:
713
            if 'switches' in d:
714
                switches = d['switches']
715
                for s in switches:
716
                    if 'name' in s:
717
                        if s['default']: