Skip to content

Commit

Permalink
Update USAGE.md to include new options for listing examples and fix t…
Browse files Browse the repository at this point in the history
…erminal reset issue
  • Loading branch information
nmaguiar committed Apr 28, 2024
1 parent fe68397 commit a9c0119
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/docs/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_.
Expand All @@ -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
Expand Down
14 changes: 10 additions & 4 deletions src/oafp.source.js.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit a9c0119

Please sign in to comment.