add main help

This commit is contained in:
Callan Bryant 2020-02-27 22:52:57 +00:00
parent 109b1d35b3
commit 32c5b1c037
No known key found for this signature in database
GPG Key ID: C31FA9DF3ACBFFAA

View File

@ -3,6 +3,7 @@ package main
import ( import (
"os" "os"
"flag" "flag"
"fmt"
"github.com/naggie/dsnet" "github.com/naggie/dsnet"
) )
@ -12,6 +13,7 @@ func main() {
switch os.Args[1] { switch os.Args[1] {
case "init": case "init":
dsnet.Init()
case "up": case "up":
@ -25,3 +27,18 @@ func main() {
help(); help();
} }
} }
func help() {
fmt.Printf(`Usage: dsnet <cmd>
Available commands:
init : Create %s containing default configuration + new keys without loading. Edit to taste.
add : Generate configuration for a new peer. (Send with passworded ffsend)
sync : Synchronise wireguard configuration with %s, creating and activating interface if necessary
To remove an interface or bring it down, use standard tools such as iproute2.
To modify or remove peers, edit %s and then run sync.
`, dstask.CONFIG_FILE, dstask.CONFIG_FILE, dstask.CONFIG_FILE)
}