Lines 36-41
Link Here
|
36 |
["-V", "--version", "some information about this tool"], |
36 |
["-V", "--version", "some information about this tool"], |
37 |
["-v", "--verbose", "print more information (option)"], |
37 |
["-v", "--verbose", "print more information (option)"], |
38 |
["-c", "--cve", "show CAN ids in listing mode (option)"], |
38 |
["-c", "--cve", "show CAN ids in listing mode (option)"], |
|
|
39 |
["-r", "--reverse","reverse the order of listing"], |
39 |
["-m", "--mail", "send a mail with the given GLSAs to the administrator"] |
40 |
["-m", "--mail", "send a mail with the given GLSAs to the administrator"] |
40 |
] |
41 |
] |
41 |
|
42 |
|
Lines 53-59
Link Here
|
53 |
try: |
54 |
try: |
54 |
args, params = getopt(sys.argv[1:], "".join([o[0][1] for o in optionmap]), \ |
55 |
args, params = getopt(sys.argv[1:], "".join([o[0][1] for o in optionmap]), \ |
55 |
[x[2:] for x in reduce(lambda x,y: x+y, [z[1:-1] for z in optionmap])]) |
56 |
[x[2:] for x in reduce(lambda x,y: x+y, [z[1:-1] for z in optionmap])]) |
56 |
# ["dump", "print", "list", "pretend", "fix", "inject", "help", "verbose", "version", "test", "nocolor", "cve", "mail"]) |
57 |
# ["dump", "print", "list", "pretend", "fix", "inject", "help", "verbose", "version", "test", "nocolor", "cve", "reverse", "mail"]) |
57 |
args = [a for a,b in args] |
58 |
args = [a for a,b in args] |
58 |
|
59 |
|
59 |
for option in ["--nocolor", "-n"]: |
60 |
for option in ["--nocolor", "-n"]: |
Lines 73-78
Link Here
|
73 |
list_cve = True |
74 |
list_cve = True |
74 |
args.remove(option) |
75 |
args.remove(option) |
75 |
|
76 |
|
|
|
77 |
list_reverse = False |
78 |
for option in ["--reverse", "-r"]: |
79 |
if option in args: |
80 |
list_reverse = True |
81 |
args.remove(option) |
82 |
|
76 |
least_change = True |
83 |
least_change = True |
77 |
for option in ["--emergelike", "-e"]: |
84 |
for option in ["--emergelike", "-e"]: |
78 |
if option in args: |
85 |
if option in args: |
Lines 229-235
Link Here
|
229 |
return 0 |
236 |
return 0 |
230 |
|
237 |
|
231 |
if mode == "list": |
238 |
if mode == "list": |
232 |
sys.exit(summarylist(glsalist)) |
239 |
if list_reverse: |
|
|
240 |
sys.exit(summarylist(reversed(glsalist))) |
241 |
else: |
242 |
sys.exit(summarylist(glsalist)) |
233 |
|
243 |
|
234 |
# dump, fix, inject and fix are nearly the same code, only the glsa method call differs |
244 |
# dump, fix, inject and fix are nearly the same code, only the glsa method call differs |
235 |
if mode in ["dump", "fix", "inject", "pretend"]: |
245 |
if mode in ["dump", "fix", "inject", "pretend"]: |