mirror of
https://github.com/tornadocash/snarkjs.git
synced 2024-10-31 23:35:40 +01:00
commit
193a1064ca
@ -58,6 +58,7 @@ export default async function clProcessor(commands) {
|
|||||||
for (let i=0; i<commands.length; i++) {
|
for (let i=0; i<commands.length; i++) {
|
||||||
const cmd = commands[i];
|
const cmd = commands[i];
|
||||||
const m = calculateMatch(commands[i], cl);
|
const m = calculateMatch(commands[i], cl);
|
||||||
|
let res;
|
||||||
if (m) {
|
if (m) {
|
||||||
if ((argv.h) || (argv.help)) {
|
if ((argv.h) || (argv.help)) {
|
||||||
helpCmd(cmd);
|
helpCmd(cmd);
|
||||||
@ -66,16 +67,16 @@ export default async function clProcessor(commands) {
|
|||||||
if (areParamsValid(cmd.cmd, m)) {
|
if (areParamsValid(cmd.cmd, m)) {
|
||||||
if (cmd.options) {
|
if (cmd.options) {
|
||||||
const options = getOptions(cmd.options);
|
const options = getOptions(cmd.options);
|
||||||
await cmd.action(m, options);
|
res = await cmd.action(m, options);
|
||||||
} else {
|
} else {
|
||||||
await cmd.action(m, {});
|
res = await cmd.action(m, {});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (m.length>0) console.log("Invalid number of parameters");
|
if (m.length>0) console.log("Invalid number of parameters");
|
||||||
helpCmd(cmd);
|
helpCmd(cmd);
|
||||||
return 99;
|
return 99;
|
||||||
}
|
}
|
||||||
return;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cl.length>0) console.log("Invalid command");
|
if (cl.length>0) console.log("Invalid command");
|
||||||
|
Loading…
Reference in New Issue
Block a user