diff options
author | Patrick Quist <partouf@gmail.com> | 2020-09-25 02:09:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-25 02:09:47 +0200 |
commit | 697c8e9296705b563b1618f73d5630c70a2fa394 (patch) | |
tree | d636faefca2ff1a681b934827ac6fce3d5a69148 /lib/utils.js | |
parent | 82faf7b9f301a8d81b836016d613f3223fa21519 (diff) | |
download | compiler-explorer-697c8e9296705b563b1618f73d5630c70a2fa394.tar.gz compiler-explorer-697c8e9296705b563b1618f73d5630c70a2fa394.zip |
support library options to be passed on to the compiler (#2215)
Diffstat (limited to 'lib/utils.js')
-rw-r--r-- | lib/utils.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/utils.js b/lib/utils.js index 8e9a9781e..259b23612 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -23,7 +23,8 @@ // POSSIBILITY OF SUCH DAMAGE. const _ = require('underscore'), - crypto = require('crypto'); + crypto = require('crypto'), + quote = require('shell-quote'); const tabsRe = /\t/g; const lineRe = /\r?\n/; @@ -375,3 +376,12 @@ function base32Encode(buffer) { } exports.base32Encode = base32Encode; + +function splitArguments(options) { + return _.chain(quote.parse(options || '') + .map(x => typeof (x) === 'string' ? x : x.pattern)) + .compact() + .value(); +} + +exports.splitArguments = splitArguments; |