--- glsa-check.old 2008-08-28 02:36:08.000000000 +0200 +++ glsa-check 2008-08-28 02:52:25.000000000 +0200 @@ -36,6 +36,7 @@ ["-V", "--version", "some information about this tool"], ["-v", "--verbose", "print more information (option)"], ["-c", "--cve", "show CAN ids in listing mode (option)"], +["-r", "--reverse","reverse the order of listing"], ["-m", "--mail", "send a mail with the given GLSAs to the administrator"] ] @@ -53,7 +54,7 @@ try: args, params = getopt(sys.argv[1:], "".join([o[0][1] for o in optionmap]), \ [x[2:] for x in reduce(lambda x,y: x+y, [z[1:-1] for z in optionmap])]) -# ["dump", "print", "list", "pretend", "fix", "inject", "help", "verbose", "version", "test", "nocolor", "cve", "mail"]) +# ["dump", "print", "list", "pretend", "fix", "inject", "help", "verbose", "version", "test", "nocolor", "cve", "reverse", "mail"]) args = [a for a,b in args] for option in ["--nocolor", "-n"]: @@ -73,6 +74,12 @@ list_cve = True args.remove(option) + list_reverse = False + for option in ["--reverse", "-r"]: + if option in args: + list_reverse = True + args.remove(option) + least_change = True for option in ["--emergelike", "-e"]: if option in args: @@ -229,7 +236,10 @@ return 0 if mode == "list": - sys.exit(summarylist(glsalist)) + if list_reverse: + sys.exit(summarylist(reversed(glsalist))) + else: + sys.exit(summarylist(glsalist)) # dump, fix, inject and fix are nearly the same code, only the glsa method call differs if mode in ["dump", "fix", "inject", "pretend"]: