From 8312528924208df59eebd633a834fcc9aa3c5e60 Mon Sep 17 00:00:00 2001 From: nmaguiar Date: Sun, 12 May 2024 06:36:16 +0100 Subject: [PATCH] support out=raw for help --- src/docs/USAGE.md | 1 + src/oafp.source.js.hbs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/docs/USAGE.md b/src/docs/USAGE.md index 3191ccb..cb139b5 100644 --- a/src/docs/USAGE.md +++ b/src/docs/USAGE.md @@ -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 | diff --git a/src/oafp.source.js.hbs b/src/oafp.source.js.hbs index fd84961..11ad4a7 100755 --- a/src/oafp.source.js.hbs +++ b/src/oafp.source.js.hbs @@ -64,7 +64,7 @@ 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 @@ -72,7 +72,7 @@ const showHelp = () => { 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 @@ -80,7 +80,7 @@ const showHelp = () => { 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) }