diff --git a/add.go b/add.go index f426be8..43ee8e9 100644 --- a/add.go +++ b/add.go @@ -7,11 +7,16 @@ import ( ) func Add() { - // TODO maybe accept flags to avoid prompt and allow programmatic use + if len(os.Args) <= 2 { + // TODO non-red + ExitFail("Hostname argument required: dsnet add ") + } + + // TODO maybe accept flags to avoid prompt and allow programmatic use? // TODO accept existing pubkey conf := MustLoadDsnetConfig() - hostname := MustPromptString("Hostname (unique)", true) + hostname := os.Args[2] owner := MustPromptString("owner", true) description := MustPromptString("Description", true) //publicKey := MustPromptString("PublicKey (optional)", false) diff --git a/remove.go b/remove.go index fce8e0d..00f777c 100644 --- a/remove.go +++ b/remove.go @@ -6,6 +6,7 @@ import ( func Remove() { if len(os.Args) <= 2 { + // TODO non-red ExitFail("Hostname argument required: dsnet remove ") } conf := MustLoadDsnetConfig()