From 8a9669f130a03fe3955f5e41e618a4ffa5163093 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 25 Sep 2019 12:36:49 -0700 Subject: [PATCH] . --- go/cmd/zerotier/cli/help.go | 76 ++++++++++++++++++++ go/cmd/zerotier/cli/service.go | 30 ++++++-- go/cmd/zerotier/zerotier.go | 64 ++--------------- go/pkg/zerotier/localconfig.go | 4 ++ go/pkg/zerotier/node.go | 104 +++++++++++++++++++++++---- go/pkg/zerotier/sizelimitwriter.go | 108 +++++++++++++++++++++++++++++ 6 files changed, 307 insertions(+), 79 deletions(-) create mode 100644 go/cmd/zerotier/cli/help.go create mode 100644 go/pkg/zerotier/sizelimitwriter.go diff --git a/go/cmd/zerotier/cli/help.go b/go/cmd/zerotier/cli/help.go new file mode 100644 index 000000000..65d6f6ce5 --- /dev/null +++ b/go/cmd/zerotier/cli/help.go @@ -0,0 +1,76 @@ +/* + * Copyright (c)2019 ZeroTier, Inc. + * + * Use of this software is governed by the Business Source License included + * in the LICENSE.TXT file in the project's root directory. + * + * Change Date: 2023-01-01 + * + * On the date above, in accordance with the Business Source License, use + * of this software will be governed by version 2.0 of the Apache License. + */ +/****/ + +package cli + +import ( + "fmt" + "zerotier/pkg/zerotier" +) + +var copyrightText = fmt.Sprintf(`ZeroTier Network Virtualization Service Version %d.%d.%d +(c)2019 ZeroTier, Inc. +Licensed under the ZeroTier BSL (see LICENSE.txt)`, zerotier.CoreVersionMajor, zerotier.CoreVersionMinor, zerotier.CoreVersionRevision) + +// Help dumps help to stdout +func Help() { + fmt.Println(copyrightText + ` + +Usage: zerotier [-options] [-options] [command args] + +Global Options + -j Output raw JSON where applicable + -p Use alternate base path + -t Use secret auth token from this file + +Commands: + help Show this help + version Print version + service Start in system service mode + status Show ZeroTier service status and config + peers Show VL1 peers + roots Show VL1 root servers + addroot [options] Add a VL1 root + static [...] Add a root with a set identity and IPs + dynamic [default locator] Add a dynamic root fetched by name + removeroot [options] Remove a VL1 root + static Remove a root with a set identity + dynamic Remove a dynamic root fetched by name + networks Show joined VL2 virtual networks + join Join a virtual network + leave Leave a virtual network + show Show verbose network info + set