From 8aab4e99d8a2e950e9e16c32243d7a659fc6084e Mon Sep 17 00:00:00 2001 From: Tim Beatham Date: Fri, 22 Dec 2023 19:08:20 +0000 Subject: [PATCH] 59-error-when-peer-not-selected In the CLI when the peer is not selected as the type throwing an error stating either client or peer must be selected --- cmd/wg-mesh/main.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cmd/wg-mesh/main.go b/cmd/wg-mesh/main.go index 956c9ff..cfe56d2 100644 --- a/cmd/wg-mesh/main.go +++ b/cmd/wg-mesh/main.go @@ -15,7 +15,6 @@ const SockAddr = "/tmp/wgmesh_ipc.sock" type CreateMeshParams struct { Client *ipcRpc.Client Endpoint string - Role string WgArgs ipc.WireGuardArgs AdvertiseRoutes bool AdvertiseDefault bool @@ -56,7 +55,6 @@ type JoinMeshParams struct { MeshId string IpAddress string Endpoint string - Role string WgArgs ipc.WireGuardArgs AdvertiseRoutes bool AdvertiseDefault bool @@ -203,6 +201,7 @@ func main() { }) var newMeshRole *string = newMeshCmd.Selector("r", "role", []string{"peer", "client"}, &argparse.Options{ + Default: "peer", Help: "Role in the mesh network. A value of peer means that the node is publicly routeable and thus considered" + " in the gossip protocol. Client means that the node is not publicly routeable and is not a candidate in the gossip" + " protocol", @@ -235,7 +234,7 @@ func main() { }) var joinMeshRole *string = joinMeshCmd.Selector("r", "role", []string{"peer", "client"}, &argparse.Options{ - Default: "Peer", + Default: "peer", Help: "Role in the mesh network. A value of peer means that the node is publicly routeable and thus considered" + " in the gossip protocol. Client means that the node is not publicly routeable and is not a candidate in the gossip" + " protocol", @@ -319,7 +318,6 @@ func main() { fmt.Println(createMesh(&CreateMeshParams{ Client: client, Endpoint: *newMeshEndpoint, - Role: *newMeshRole, WgArgs: ipc.WireGuardArgs{ Endpoint: *newMeshEndpoint, Role: *newMeshRole, @@ -341,7 +339,6 @@ func main() { IpAddress: *joinMeshIpAddress, MeshId: *joinMeshId, Endpoint: *joinMeshEndpoint, - Role: *joinMeshRole, WgArgs: ipc.WireGuardArgs{ Endpoint: *joinMeshEndpoint, Role: *joinMeshRole,