mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-11-30 13:35:19 +00:00
Merge pull request #232 from neilalexander/yggdrasilctl
Update yggdrasilctl help text
This commit is contained in:
commit
9724dd2351
@ -41,6 +41,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||||||
- Latency-based parent selection for the switch instead of uptime-based
|
- Latency-based parent selection for the switch instead of uptime-based
|
||||||
- Real peering endpoints now shown in the admin socket `getPeers` call
|
- Real peering endpoints now shown in the admin socket `getPeers` call
|
||||||
- Reuse the multicast port on supported platforms so that multiple Yggdrasil processes can run
|
- Reuse the multicast port on supported platforms so that multiple Yggdrasil processes can run
|
||||||
|
- `yggdrasilctl` now has more useful help text (with `-help` or when no arguments passed)
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Memory leaks in the DHT fixed
|
- Memory leaks in the DHT fixed
|
||||||
|
@ -18,18 +18,26 @@ import (
|
|||||||
type admin_info map[string]interface{}
|
type admin_info map[string]interface{}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
flag.Usage = func() {
|
||||||
|
fmt.Fprintf(flag.CommandLine.Output(), "Usage: %s [options] command [key=value] [key=value] ...\n", os.Args[0])
|
||||||
|
fmt.Println("Options:")
|
||||||
|
flag.PrintDefaults()
|
||||||
|
fmt.Println("Commands:\n - Use \"list\" for a list of available commands")
|
||||||
|
fmt.Println("Examples:")
|
||||||
|
fmt.Println(" - ", os.Args[0], "list")
|
||||||
|
fmt.Println(" - ", os.Args[0], "getPeers")
|
||||||
|
fmt.Println(" - ", os.Args[0], "setTunTap name=auto mtu=1500 tap_mode=false")
|
||||||
|
fmt.Println(" - ", os.Args[0], "-endpoint=tcp://localhost:9001 getDHT")
|
||||||
|
fmt.Println(" - ", os.Args[0], "-endpoint=unix:///var/run/ygg.sock getDHT")
|
||||||
|
}
|
||||||
server := flag.String("endpoint", defaults.GetDefaults().DefaultAdminListen, "Admin socket endpoint")
|
server := flag.String("endpoint", defaults.GetDefaults().DefaultAdminListen, "Admin socket endpoint")
|
||||||
injson := flag.Bool("json", false, "Output in JSON format")
|
injson := flag.Bool("json", false, "Output in JSON format (as opposed to pretty-print)")
|
||||||
verbose := flag.Bool("v", false, "Verbose output (includes public keys)")
|
verbose := flag.Bool("v", false, "Verbose output (includes public keys)")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
args := flag.Args()
|
args := flag.Args()
|
||||||
|
|
||||||
if len(args) == 0 {
|
if len(args) == 0 {
|
||||||
fmt.Println("usage:", os.Args[0], "[-endpoint=proto://server] [-v] [-json] command [key=value] [...]")
|
flag.Usage()
|
||||||
fmt.Println("example:", os.Args[0], "getPeers")
|
|
||||||
fmt.Println("example:", os.Args[0], "setTunTap name=auto mtu=1500 tap_mode=false")
|
|
||||||
fmt.Println("example:", os.Args[0], "-endpoint=tcp://localhost:9001 getDHT")
|
|
||||||
fmt.Println("example:", os.Args[0], "-endpoint=unix:///var/run/ygg.sock getDHT")
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user