From: Alexandre Terrasa Date: Mon, 29 Jul 2013 22:34:34 +0000 (-0400) Subject: ni: use command ":q" to quit, blank line do nothing X-Git-Tag: v0.6.1~73^2~5^2~3 X-Git-Url: http://nitlanguage.org ni: use command ":q" to quit, blank line do nothing Signed-off-by: Alexandre Terrasa --- diff --git a/src/ni.nit b/src/ni.nit index 8c169f3..4f3ad39 100644 --- a/src/ni.nit +++ b/src/ni.nit @@ -74,8 +74,8 @@ class NitIndex print "\tname\t\tlookup module, class and property with the corresponding 'name'" print "\tparam: Type\tlookup methods using the corresponding 'Type' as parameter" print "\treturn: Type\tlookup methods returning the corresponding 'Type'" - print "\tEnter a blank line to exit.\n" - print "\nLoaded modules:" + print "\tEnter ':q' to exit\n" + print "Loaded modules:" var mmodules = new Array[MModule] mmodules.add_all(model.mmodules) var sorter = new MModuleNameSorter @@ -83,6 +83,7 @@ class NitIndex for m in mmodules do print "\t{m.name}" end + print "" end fun prompt do @@ -91,7 +92,11 @@ class NitIndex end fun seek(entry: String) do - if entry.is_empty then exit(0) + if entry.is_empty then + prompt + return + end + if entry == ":q" then exit(0) var pager = new Pager # seek return types if entry.has_prefix("return:") then