Handle required parameter
This commit is contained in:
parent
65934ea570
commit
b7671b9a97
1 changed files with 6 additions and 1 deletions
7
main.go
7
main.go
|
@ -20,12 +20,17 @@ import (
|
||||||
func main() {
|
func main() {
|
||||||
useClient := flag.Bool("c", false, "Run client")
|
useClient := flag.Bool("c", false, "Run client")
|
||||||
|
|
||||||
keyPath := flag.String("key", "", "Path to the private (client mode) or public (server mode) to use")
|
keyPath := flag.String("key", "", "Path to the private key (client mode) or public key (server mode) to use - Required")
|
||||||
|
|
||||||
simulateCaddy := flag.Bool("caddy", false, "Simulate caddy reverse proxy")
|
simulateCaddy := flag.Bool("caddy", false, "Simulate caddy reverse proxy")
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
if *keyPath == "" {
|
||||||
|
flag.PrintDefaults()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if *useClient {
|
if *useClient {
|
||||||
runClient(keyPath, *simulateCaddy)
|
runClient(keyPath, *simulateCaddy)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue