Skip to content

Commit d3ccbae

Browse files
committed
feat: Add more descriptive tooltips for scan options
1 parent b7d689b commit d3ccbae

File tree

4 files changed

+41
-30
lines changed

4 files changed

+41
-30
lines changed

backend/entities/scan.go

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -34,38 +34,47 @@ type ScanArgDef struct {
3434
Shorthand string
3535
Default interface{}
3636
Usage string
37+
Tooltip string
3738
Type string
3839
IsCore bool
3940
IsFileSelector bool
4041
}
4142

4243
var (
4344
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},
45+
{"wfp", "w", "", "Scan a WFP File instead of a folder (optional)", "", "string", false, true},
46+
{"dep", "p", "", "Use a dependency file instead of a folder (optional)", "", "string", false, true},
47+
{"stdin", "s", "", "Scan the file contents supplied via STDIN (optional)", "", "string", false, false},
48+
{"files", "e", []string{}, "List of files to scan.", "", "stringSlice", false, false},
49+
{"identify", "i", "", "Scan and identify components in SBOM file", "", "string", false, true},
50+
{"ignore", "n", "", "Ignore components specified in the SBOM file", "", "string", false, true},
51+
{"output", "o", "", "Output result file name (optional - default stdout).",
52+
"Location where the scan results will be saved", "", true, true},
53+
{"format", "f", "plain", "Result output format (optional - default: plain)", "", "string", false, false},
54+
{"threads", "T", 5, "Number of threads to use while scanning (optional - default 5)",
55+
"", "int", false, false},
56+
{"flags", "F", 0, "Scanning engine flags",
57+
"Advanced scanning engine configuration flags", "int", false, false},
58+
{"post-size", "P", 32, "Number of kilobytes to limit the post to while scanning (optional - default 32)",
59+
"Limits the size of each scan request to improve performance and reliability", "int", false, false},
60+
{"timeout", "M", 180, "Timeout (in seconds) for API communication (optional - default 180)", "", "int", false, false},
61+
{"retry", "R", 5, "Retry limit for API communication (optional - default 5)", "", "int", false, false},
62+
{"no-wfp-output", "", false, "Skip WFP file generation", "", "bool", false, false},
63+
{"dependencies", "D", false, "Add Dependency scanning", "", "bool", false, false},
64+
{"dependencies-only", "", false, "Run Dependency scanning only", "", "bool", false, false},
65+
{"sc-command", "", "", "Scancode command and path if required (optional - default scancode).", "", "string", false, false},
66+
{"sc-timeout", "", 600, "Timeout (in seconds) for scancode to complete (optional - default 600)", "", "int", false, false},
67+
{"dep-scope", "", "", "Filter dependencies by scope - default all (options: dev/prod)", "", "string", false, false},
68+
{"dep-scope-inc", "", "", "Include dependencies with declared scopes", "", "string", false, false},
69+
{"dep-scope-exc", "", "", "Exclude dependencies with declared scopes", "", "string", false, false},
70+
{"settings", "", "", "Settings file to use for scanning (optional - default scanoss.json)",
71+
"Configuration file that defines scanning behavior and rules", "string", true, true},
72+
{"skip-settings-file", "", false, "Skip default settings file (scanoss.json) if it exists", "", "", false, false},
73+
{"debug", "d", false, "Enable debug messages",
74+
"Show detailed diagnostic information during scanning", "bool", true, false},
75+
{"trace", "t", false, "Enable trace messages, including API posts",
76+
"Display all API communication and detailed execution steps", "bool", true, false},
77+
{"quiet", "q", true, "Enable quiet mode",
78+
"Suppress non-essential output messages", "bool", true, false},
7079
}
7180
)

frontend/src/components/ScanDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ export default function ScanDialog({ onOpenChange }: ScanDialogProps) {
246246
type={arg.Type.toLowerCase() as 'string' | 'int' | 'bool' | 'stringSlice'}
247247
value={options[arg.Name]}
248248
defaultValue={arg.Default}
249-
usage={arg.Usage}
249+
tooltip={arg.Tooltip}
250250
onChange={(value) => handleOptionChange(arg.Name, value)}
251251
onSelectFile={arg.IsFileSelector ? () => handleFileSelect(arg.Name)() : undefined}
252252
isFileSelector={arg.IsFileSelector}

frontend/src/components/ScanOption.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ interface ScanOptionProps {
3434
type: 'string' | 'int' | 'bool' | 'stringSlice';
3535
value: string | number | boolean | string[];
3636
defaultValue: string | number | boolean | string[];
37-
usage: string;
37+
tooltip: string;
3838
onChange: (value: string | number | boolean | string[]) => void;
3939
onSelectFile?: () => void;
4040
isFileSelector?: boolean;
4141
}
4242

43-
export default function ScanOption({ name, type, value, defaultValue, usage, onChange, onSelectFile, isFileSelector }: ScanOptionProps) {
43+
export default function ScanOption({ name, type, value, defaultValue, tooltip, onChange, onSelectFile, isFileSelector }: ScanOptionProps) {
4444
const displayName = name
4545
.split('-')
4646
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
@@ -132,7 +132,7 @@ export default function ScanOption({ name, type, value, defaultValue, usage, onC
132132
<Tooltip>
133133
<TooltipTrigger asChild>{renderInput()}</TooltipTrigger>
134134
<TooltipContent>
135-
<p>{usage}</p>
135+
<p>{tooltip}</p>
136136
</TooltipContent>
137137
</Tooltip>
138138
);

frontend/wailsjs/go/models.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ export namespace entities {
375375
Shorthand: string;
376376
Default: any;
377377
Usage: string;
378+
Tooltip: string;
378379
Type: string;
379380
IsCore: boolean;
380381
IsFileSelector: boolean;
@@ -389,6 +390,7 @@ export namespace entities {
389390
this.Shorthand = source["Shorthand"];
390391
this.Default = source["Default"];
391392
this.Usage = source["Usage"];
393+
this.Tooltip = source["Tooltip"];
392394
this.Type = source["Type"];
393395
this.IsCore = source["IsCore"];
394396
this.IsFileSelector = source["IsFileSelector"];

0 commit comments

Comments
 (0)