Skip to content

Commit

Permalink
support out=raw for help
Browse files Browse the repository at this point in the history
  • Loading branch information
nmaguiar committed May 12, 2024
1 parent a9c0119 commit 8312528
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/docs/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Takes an input, usually a data structure such as json, and transforms it to an e
| urldata | If 'url' is provided a JSON/SLON/text data can be provided |
| loop | If defined will loop the processing by the number of seconds provided |
| loopcls | If 'true' and loop is defined it will clear the screen (or file) on each loop cycle |
| libs | Comma delimited list of installed OpenAF's oPacks to consider to extend oafp's inputs, transformations and outputs |
| -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 |
| version | Alternative way to change the input to a map with the tool's version |
Expand Down
6 changes: 3 additions & 3 deletions src/oafp.source.js.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,23 @@ const showHelp = () => {
if (isDef(ow.format.string.pauseString) && toBoolean(params.pause))
ow.format.string.pauseString( ow.format.withMD( io.readFileString(_f) + _customHelp ) )
else
_print(ow.format.withMD( io.readFileString(_f) + _customHelp ))
_print((isDef(params.out) && params.out == "raw") ? io.readFileString(_f) + _customHelp : ow.format.withMD( io.readFileString(_f) + _customHelp ))
} else {
if (isDef(global._oafphelp) && isDef(global._oafphelp[_ff])) {
__ansiColorFlag = true
__conConsole = true
if (isDef(ow.format.string.pauseString) && toBoolean(params.pause))
ow.format.string.pauseString( ow.format.withMD( global._oafphelp[_ff] + _customHelp ) )
else
_print(ow.format.withMD( global._oafphelp[_ff] + _customHelp))
_print((isDef(params.out) && params.out == "raw") ? global._oafphelp[_ff] + _customHelp : ow.format.withMD( global._oafphelp[_ff] + _customHelp))
} else {
if (isString(_oafhelp_libs[params.help])) {
__ansiColorFlag = true
__conConsole = true
if (isDef(ow.format.string.pauseString) && toBoolean(params.pause))
ow.format.string.pauseString( ow.format.withMD( _oafhelp_libs[params.help] ) )
else
_print(ow.format.withMD( _oafhelp_libs[params.help] ))
_print((isDef(params.out) && params.out == "raw") ? _oafhelp_libs[params.help] : ow.format.withMD( _oafhelp_libs[params.help] ))
} else {
_print("Check https://github.com/OpenAF/oafp/blob/master/src/" + _ff)
}
Expand Down

0 comments on commit 8312528

Please sign in to comment.