-i assumed unless file specified or input piped in.
h3rald h3rald@h3rald.com
Tue, 12 Jan 2021 23:21:16 +0000
3 files changed,
16 insertions(+),
16 deletions(-)
M
min.nim
→
min.nim
@@ -278,7 +278,8 @@ contents = fileLines.join("\n")
minStream(newStringStream(contents), fn, op, main) when isMainModule: - + when not defined(mini): + import terminal import parseopt, critbits,@@ -286,13 +287,10 @@ minpkg/core/meta
var REPL = false var SIMPLEREPL = false - var INSTALL = false - var UNINSTALL = false var COMPILE = false var MODULEPATH = "" - var libfile = "" var exeName = "min" - var iOpt = "\n -i, --interactive Start $1 shell (with advanced prompt)\n" + var iOpt = "\n -i, --interactive Start $1 shell (with advanced prompt, default if no file specidied)\n" when defined(lite): exeName = "litemin" when defined(mini):@@ -350,6 +348,7 @@ i.stdLib()
var s = newStringStream("") i.open(s, "<repl>") var line: string + echo "$# shell v$#" % [exeName, pkgVersion] while true: let symbols = toSeq(i.scope.symbols.keys) EDITOR.completionCallback = proc(ed: LineEditor): seq[string] =@@ -380,7 +379,7 @@ Usage:
$exe [options] [filename] Arguments: - filename A $exe file to interpret or compile (default: STDIN). + filename A $exe file to interpret or compile Options: -a, --asset-path Specify a directory containing the asset files to include in the compiled executable (if -c is set)@@ -450,14 +449,6 @@ REPL = true
of "interactive-simple", "j": if file == "": SIMPLEREPL = true - of "install": - if file == "" and not defined(mini): - INSTALL = true - libfile = val - of "uninstall": - if file == "" and not defined(mini): - UNINSTALL = true - libfile = val else: discard else:@@ -482,4 +473,11 @@ elif SIMPLEREPL:
minSimpleRepl() quit(0) else: - minStream newFileStream(stdin), "stdin", op + when defined(mini): + minStream newFileStream(stdin), "stdin", op + else: + if isatty(stdin): + minRepl() + quit(0) + else: + minStream newFileStream(stdin), "stdin", op
M
next-release.md
→
next-release.md
@@ -2,3 +2,4 @@ * Added **dsinit!** symbol.
* Added **sealed?** and **sealed-sigil?** symbols. + **floor** and **ceil** now correctly return an integer again. * Added **abs** symbol. +* Now executing min shell if no file is specified (unless input is piped in), without the need of specifying **-i**.
M
site/contents/get-started.md
→
site/contents/get-started.md
@@ -106,9 +106,10 @@ * No environment configuration files ([.minrc](class:file), [.min_symbols](class:file)) are used.
## Running the min Shell -To start min shell, run [min -i](class:cmd). You will be presented with a prompt displaying the path to the current directory: +To start the min shell, run [min](class:cmd) with no arguments. You will be presented with a prompt displaying the path to the current directory: > %min-terminal% +> min shell v$versio > [[/Users/h3rald/test]$](class:prompt) You can type min code and press [ENTER](class:kbd) to evaluate it immediately: