Skip to content

Commit ed28233

Browse files
committed
Parse global options
1 parent 6819f1c commit ed28233

24 files changed

Lines changed: 68 additions & 60 deletions

cmds/archives.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ const util = require("../src/util");
2424
exports.command = ['archives', 'sources'];
2525
exports.desc = 'list out all package archives';
2626

27-
exports.handler = async ({ global }) => {
28-
await util.e_call('archives', util.def_flag(global, '-g'));
27+
exports.handler = async (argv) => {
28+
await util.e_call(argv, 'archives');
2929
};

cmds/autoloads.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ const util = require("../src/util");
2424
exports.command = "autoloads";
2525
exports.desc = "generate autoloads file";
2626

27-
exports.handler = async ({ }) => {
28-
await util.e_call('autoloads');
27+
exports.handler = async (argv) => {
28+
await util.e_call(argv, 'autoloads');
2929
};

cmds/clean-all.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ const util = require("../src/util");
2424
exports.command = "clean-all";
2525
exports.desc = "do all cleaning tasks";
2626

27-
exports.handler = async ({ }) => {
28-
await util.e_call('clean-all');
27+
exports.handler = async (argv) => {
28+
await util.e_call(argv, 'clean-all');
2929
};

cmds/clean-elc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ const util = require("../src/util");
2424
exports.command = 'clean-elc';
2525
exports.desc = 'remove byte compiled files generated by cask build';
2626

27-
exports.handler = async ({}) => {
28-
await util.e_call('clean-elc');
27+
exports.handler = async (argv) => {
28+
await util.e_call(argv, 'clean-elc');
2929
};

cmds/clean.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ const util = require("../src/util");
2424
exports.command = "clean";
2525
exports.desc = "clean up local .eask directory";
2626

27-
exports.handler = async ({ }) => {
28-
await util.e_call('clean');
27+
exports.handler = async (argv) => {
28+
await util.e_call(argv, 'clean');
2929
};

cmds/compile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ exports.builder = {
3131
},
3232
};
3333

34-
exports.handler = async ({ names }) => {
35-
await util.e_call('compile', names);
34+
exports.handler = async (argv) => {
35+
await util.e_call(argv, 'compile', argv.names);
3636
};

cmds/eval.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ exports.builder = {
3131
},
3232
};
3333

34-
exports.handler = async ({ form }) => {
35-
await util.e_call('eval', '\"' + form.replace(/[\\$'"]/g, "\\$&") + '\"');
34+
exports.handler = async (argv) => {
35+
await util.e_call(argv, 'eval', '\"' + argv.form.replace(/[\\$'"]/g, "\\$&") + '\"');
3636
};

cmds/exec-path.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ const util = require("../src/util");
2626
exports.command = ['path', 'exec-path'];
2727
exports.desc = 'print the PATH (exec-path) from workspace';
2828

29-
exports.handler = async ({ global }) => {
30-
await util.e_call('exec-path', util.def_flag(global, '-g'));
29+
exports.handler = async (argv) => {
30+
await util.e_call(argv, 'exec-path');
3131
};

cmds/exec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ exports.builder = {
3131
},
3232
};
3333

34-
exports.handler = async ({ args }) => {
34+
exports.handler = async (argv) => {
3535
await util.e_call('exec', '--', process.argv.slice(3));
3636
};

cmds/files.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ const util = require("../src/util");
2424
exports.command = 'files';
2525
exports.desc = 'print the list of all package files';
2626

27-
exports.handler = async ({}) => {
28-
await util.e_call('files');
27+
exports.handler = async (argv) => {
28+
await util.e_call(argv, 'files');
2929
};

0 commit comments

Comments
 (0)