Browse Source

Print defaults if no flags specified

main
Unbewohnte 3 years ago
parent
commit
d30ac7900e
  1. 2
      main.go

2
main.go

@ -35,7 +35,7 @@ func validateFlags() {
// check for default values in vital flags in case they were not provided // check for default values in vital flags in case they were not provided
if strings.TrimSpace(*SENDERADDR) == "" && strings.TrimSpace(*SHAREDFILE) == "" { if strings.TrimSpace(*SENDERADDR) == "" && strings.TrimSpace(*SHAREDFILE) == "" {
fmt.Println("--help to see available flags") flag.PrintDefaults()
os.Exit(-1) os.Exit(-1)
} else if !SENDING && strings.TrimSpace(*SENDERADDR) == "" { } else if !SENDING && strings.TrimSpace(*SENDERADDR) == "" {
fmt.Println("No specified sender`s address") fmt.Println("No specified sender`s address")

Loading…
Cancel
Save