From 14e0ca9a3b9f1479d9412d83b2b1aec5969c4667 Mon Sep 17 00:00:00 2001 From: Hans Raaf Date: Mon, 11 Jan 2016 02:15:16 +0100 Subject: [PATCH] This change sorts the list of the installed modules by name. It also adds some files to .gitignore to make checkins easier. --- .gitignore | 5 +++++ src/nimble.nim | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index bd1ebed..5199260 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,8 @@ nimcache/ /src/babel /src/nimble /tests/tester + +# executables from test and build +/nimble +/tests/nimscript/nimscript +/tests/issue27/issue27 diff --git a/src/nimble.nim b/src/nimble.nim index f28f4c6..46f098a 100644 --- a/src/nimble.nim +++ b/src/nimble.nim @@ -631,7 +631,7 @@ proc list(options: Options) = echo(" ") proc listInstalled(options: Options) = - var h = initTable[string, seq[string]]() + var h = initOrderedTable[string, seq[string]]() let pkgs = getInstalledPkgs(options.getPkgsDir(), options) for x in pkgs.items(): let @@ -641,6 +641,8 @@ proc listInstalled(options: Options) = var s = h[pName] add(s, pVer) h[pName] = s + + h.sort(proc (a,b: auto): int = cmpIgnoreCase(a[0],b[0])) for k in keys(h): echo k & " [" & h[k].join(", ") & "]"