@@ -28,3 +28,44 @@ type ScanResponse struct {
2828 ErrOutput string `json:"error_output,omitempty"`
2929 Error error `json:"error,omitempty"`
3030}
31+
32+ type ScanArgDef struct {
33+ Name string
34+ Shorthand string
35+ Default interface {}
36+ Usage string
37+ Type string
38+ IsCore bool
39+ IsFileSelector bool
40+ }
41+
42+ var (
43+ ScanArguments = []ScanArgDef {
44+ {"wfp" , "w" , "" , "Scan a WFP File instead of a folder (optional)" , "string" , false , true },
45+ {"dep" , "p" , "" , "Use a dependency file instead of a folder (optional)" , "string" , false , true },
46+ {"stdin" , "s" , "" , "Scan the file contents supplied via STDIN (optional)" , "string" , false , false },
47+ {"files" , "e" , []string {}, "List of files to scan." , "stringSlice" , false , false },
48+ {"identify" , "i" , "" , "Scan and identify components in SBOM file" , "string" , false , true },
49+ {"ignore" , "n" , "" , "Ignore components specified in the SBOM file" , "string" , false , true },
50+ {"output" , "o" , "" , "Output result file name (optional - default stdout)." , "string" , true , true },
51+ {"format" , "f" , "plain" , "Result output format (optional - default: plain)" , "string" , false , false },
52+ {"threads" , "T" , 5 , "Number of threads to use while scanning (optional - default 5)" , "int" , false , false },
53+ {"flags" , "F" , 0 , "Scanning engine flags" , "int" , false , false },
54+ {"post-size" , "P" , 32 , "Number of kilobytes to limit the post to while scanning (optional - default 32)" , "int" , false , false },
55+ {"timeout" , "M" , 180 , "Timeout (in seconds) for API communication (optional - default 180)" , "int" , false , false },
56+ {"retry" , "R" , 5 , "Retry limit for API communication (optional - default 5)" , "int" , false , false },
57+ {"no-wfp-output" , "" , false , "Skip WFP file generation" , "bool" , false , false },
58+ {"dependencies" , "D" , false , "Add Dependency scanning" , "bool" , false , false },
59+ {"dependencies-only" , "" , false , "Run Dependency scanning only" , "bool" , false , false },
60+ {"sc-command" , "" , "" , "Scancode command and path if required (optional - default scancode)." , "string" , false , false },
61+ {"sc-timeout" , "" , 600 , "Timeout (in seconds) for scancode to complete (optional - default 600)" , "int" , false , false },
62+ {"dep-scope" , "" , "" , "Filter dependencies by scope - default all (options: dev/prod)" , "string" , false , false },
63+ {"dep-scope-inc" , "" , "" , "Include dependencies with declared scopes" , "string" , false , false },
64+ {"dep-scope-exc" , "" , "" , "Exclude dependencies with declared scopes" , "string" , false , false },
65+ {"settings" , "" , "" , "Settings file to use for scanning (optional - default scanoss.json)" , "string" , true , true },
66+ {"skip-settings-file" , "" , false , "Skip default settings file (scanoss.json) if it exists" , "bool" , false , false },
67+ {"debug" , "d" , false , "Enable debug messages" , "bool" , true , false },
68+ {"trace" , "t" , false , "Enable trace messages, including API posts" , "bool" , true , false },
69+ {"quiet" , "q" , true , "Enable quiet mode" , "bool" , true , false },
70+ }
71+ )
0 commit comments