Skip to content

Commit

Permalink
Allow arg push
Browse files Browse the repository at this point in the history
  • Loading branch information
131 committed Jun 15, 2024
1 parent 3fad8a4 commit 868f1e2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@ const read = require('read');

const COLS = 96;

module.exports = function(module, module_name) {
// args can shift pre-imposed design, like ['--ir://start=hi', '--ir://run=']
module.exports = function(module, module_name, args = []) {

const cmdline = process.argv.slice(2);

if(args.length) {
let i = args.pop(), v = cmdline.shift() || '';
cmdline.unshift(...args, `${i}${v}`);
}

const cmdline_parsed = parseargs(cmdline);

cmdline_parsed.dict['ir://name'] = module_name || module.name || "app";
Expand All @@ -35,4 +42,5 @@ module.exports = function(module, module_name) {
cnyks.cols = Math.min(process.stdout.columns - 2, COLS);
});

return cmdline_parsed;
};

0 comments on commit 868f1e2

Please sign in to comment.