MCPcopy Index your code
hub / github.com/AutoForgeAI/autoforge / getFlagValue

Function getFlagValue

lib/cli.js:787–791  ·  view source on GitHub ↗

* Extract the value following a flag from the args array. * E.g. getFlagValue(['--port', '9000', '--host', '0.0.0.0'], '--port') => '9000'

(args, flag)

Source from the content-addressed store, hash-verified

785 * E.g. getFlagValue(['--port', '9000', '--host', '0.0.0.0'], '--port') => '9000'
786 */
787function getFlagValue(args, flag) {
788 const idx = args.indexOf(flag);
789 if (idx === -1 || idx + 1 >= args.length) return null;
790 return args[idx + 1];
791}

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected