MCPcopy
hub / github.com/snyk/cli / processCommandArgs

Function processCommandArgs

src/cli/commands/process-command-args.ts:3–20  ·  view source on GitHub ↗
(...args)

Source from the content-addressed store, hash-verified

1import { Options } from '../../lib/types';
2
3export function processCommandArgs<CommandOptions>(...args): {
4 paths: string[];
5 options: Options & CommandOptions;
6} {
7 let options = {} as any as Options & CommandOptions;
8
9 if (typeof args[args.length - 1] === 'object') {
10 options = args.pop() as any as Options & CommandOptions;
11 }
12 args = args.filter(Boolean);
13
14 // For repository scanning, populate with default path (cwd) if no path given
15 if (args.length === 0 && !options.docker) {
16 args.unshift(process.cwd());
17 }
18
19 return { options, paths: args };
20}

Callers 7

describe.tsFile · 0.90
appsFunction · 0.90
testFunction · 0.90
index.tsFile · 0.90
monitorFunction · 0.90

Calls

no outgoing calls

Tested by 1

testFunction · 0.72