MCPcopy Create free account
hub / github.com/dailydotdev/apps / flag

Function flag

packages/world-cli/bin/world.js:64–69  ·  view source on GitHub ↗
(name, dflt = undefined)

Source from the content-addressed store, hash-verified

62const command = args[0];
63
64const flag = (name, dflt = undefined) => {
65 const i = args.indexOf(`--${name}`);
66 if (i < 0) return dflt;
67 const next = args[i + 1];
68 return next && !next.startsWith("--") ? next : true;
69};
70const positional = args.slice(1).filter((a, i, all) => {
71 if (a.startsWith("--")) return false;
72 const prev = all[i - 1];

Callers 5

runInspectFunction · 0.85
runCheckFunction · 0.85
runCreateFunction · 0.85
runDevFunction · 0.85
runPaletteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected