add: hostname as arg like remove
This commit is contained in:
parent
8c5aaee793
commit
b697afc2ee
9
add.go
9
add.go
@ -7,11 +7,16 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func Add() {
|
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 <hostname>")
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO maybe accept flags to avoid prompt and allow programmatic use?
|
||||||
// TODO accept existing pubkey
|
// TODO accept existing pubkey
|
||||||
conf := MustLoadDsnetConfig()
|
conf := MustLoadDsnetConfig()
|
||||||
|
|
||||||
hostname := MustPromptString("Hostname (unique)", true)
|
hostname := os.Args[2]
|
||||||
owner := MustPromptString("owner", true)
|
owner := MustPromptString("owner", true)
|
||||||
description := MustPromptString("Description", true)
|
description := MustPromptString("Description", true)
|
||||||
//publicKey := MustPromptString("PublicKey (optional)", false)
|
//publicKey := MustPromptString("PublicKey (optional)", false)
|
||||||
|
@ -6,6 +6,7 @@ import (
|
|||||||
|
|
||||||
func Remove() {
|
func Remove() {
|
||||||
if len(os.Args) <= 2 {
|
if len(os.Args) <= 2 {
|
||||||
|
// TODO non-red
|
||||||
ExitFail("Hostname argument required: dsnet remove <hostname>")
|
ExitFail("Hostname argument required: dsnet remove <hostname>")
|
||||||
}
|
}
|
||||||
conf := MustLoadDsnetConfig()
|
conf := MustLoadDsnetConfig()
|
||||||
|
Loading…
Reference in New Issue
Block a user