Skip to content

Commit 72c1ed1

Browse files
committed
Handle missing params
1 parent 8e37e2b commit 72c1ed1

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

sprint/cmd/fingerprintCmd.go

+5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ var (
2121
Use: "host [fqdn or ip]",
2222
Short: "Get ssl fingerprint of a URL",
2323
Run: func(cmd *cobra.Command, args []string) {
24+
if len(args) == 0 {
25+
cmd.Help()
26+
os.Exit(1)
27+
}
28+
2429
host := args[0]
2530

2631
// Default to show SHA 1 if no modes are selected

sprint/cmd/matchCmd.go

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ var (
1414
Use: "match [fqdn or ip] [fingerprint]",
1515
Short: "Get ssl fingerprint of a URL and check if it matches the given fqdn or ip",
1616
Run: func(cmd *cobra.Command, args []string) {
17+
if len(args) == 0 {
18+
cmd.Help()
19+
os.Exit(1)
20+
}
21+
1722
domainURL := args[0]
1823
fingerprint := args[1]
1924

0 commit comments

Comments
 (0)