Skip to content

Commit

Permalink
chore(agoric-cli): Improve agoric start argument handling
Browse files Browse the repository at this point in the history
  • Loading branch information
gibson042 committed Jul 10, 2023
1 parent 11c4aad commit 53ff8a7
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions packages/agoric-cli/src/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,27 +742,22 @@ export default async function startMain(progname, rawArgs, powers, opts) {
}

const profiles = {
__proto__: null,
dev: startFakeChain,
'local-chain': startLocalChain,
'local-solo': startLocalSolo,
testnet: opts.dockerTag ? startTestnetDocker : startTestnetSdk,
};

const popts = opts;

const args = rawArgs.slice(1);
const profileName = args[0] || 'dev';
const [_command = 'start', profileName = 'dev', ...args] = rawArgs;
const startFn = profiles[profileName];
if (!startFn) {
const profileNames = Object.keys(profiles).join(', ');
log.error(
`unrecognized profile name ${profileName}; use one of: ${Object.keys(
profiles,
)
.sort()
.join(', ')}`,
`unrecognized profile name ${profileName}; use one of: ${profileNames}`,
);
return 1;
}

return startFn(profileName, args[0] ? args.slice(1) : args, popts);
return startFn(profileName, args, opts);
}

0 comments on commit 53ff8a7

Please sign in to comment.