exact check for number of args

This commit is contained in:
Callan Bryant 2020-03-14 14:51:49 +00:00
parent ea5ffaa4e2
commit a35ab76c22
No known key found for this signature in database
GPG Key ID: C31FA9DF3ACBFFAA
2 changed files with 2 additions and 2 deletions

2
add.go
View File

@ -9,7 +9,7 @@ import (
) )
func Add() { func Add() {
if len(os.Args) <= 2 { if len(os.Args) != 3 {
// TODO non-red // TODO non-red
ExitFail("Hostname argument required: dsnet add <hostname>") ExitFail("Hostname argument required: dsnet add <hostname>")
} }

View File

@ -5,7 +5,7 @@ import (
) )
func Remove() { func Remove() {
if len(os.Args) <= 2 { if len(os.Args) != 3 {
// TODO non-red // TODO non-red
ExitFail("Hostname argument required: dsnet remove <hostname>") ExitFail("Hostname argument required: dsnet remove <hostname>")
} }