diff --git a/src/docs/USAGE.md b/src/docs/USAGE.md index 21c1912..3191ccb 100644 --- a/src/docs/USAGE.md +++ b/src/docs/USAGE.md @@ -37,9 +37,8 @@ Takes an input, usually a data structure such as json, and transforms it to an e | loopcls | If 'true' and loop is defined it will clear the screen (or file) on each loop cycle | | -examples | Will access an internet based list of oafp examples and list them | | examples | Will search the provided keyword or 'category::subcategory' in the internet based list of oafp examples | -| -v | Changes the input to a map with the tool's version info | | version | Alternative way to change the input to a map with the tool's version | -| -r | Resets the terminal before displaying an output (use this if you experience terminal related issues) | +| -v | Changes the input to a map with the tool's version info | > Filter options apply in the following order: _path_, _from_ and _sql_. @@ -49,6 +48,8 @@ Takes an input, usually a data structure such as json, and transforms it to an e > _sqlfilterstable_ assumes and forces _sqlfilter=advanced_ +> Use 'OAFP_NORESET=true' to forces not to reset the terminal before waiting for input or displaying an output (use this if you experience terminal related issues) + --- ## ⬇️ Input types diff --git a/src/oafp.source.js.hbs b/src/oafp.source.js.hbs index 0f9401d..fd84961 100755 --- a/src/oafp.source.js.hbs +++ b/src/oafp.source.js.hbs @@ -143,7 +143,7 @@ params.input = params.type if (isUnDef(params.file) && isUnDef(params.cmd)) { let _found = __ for (let key in params) { - if (params[key] === "" && key != "-debug" && key != "-v" && key != "-r" && key != "-examples") { + if (params[key] === "" && key != "-debug" && key != "-v" && key != "-examples") { _found = key break; } @@ -266,10 +266,16 @@ params.format = _$(params.format, "format").isString().default(__) // Initialize console detection __initializeCon() -if (isDef(params["-r"])) { - if (!String(java.lang.System.getProperty("os.name")).match(/Windows/)) __con.getTerminal().settings.set("sane") - delete params["-r"] +var _dr = !String(java.lang.System.getProperty("os.name")).match(/Windows/) +var _drev = getEnv("OAFP_RESET") +if (isDef(_drev)) { + if (toBoolean(_drev)) { + _dr = false + } else { + _dr = true + } } +if (_dr) __con.getTerminal().settings.set("sane") // Check for OpenAF's sec buckets