Skip to content

Commit

Permalink
add network flag to wireguard create
Browse files Browse the repository at this point in the history
  • Loading branch information
mattvr committed Aug 7, 2024
1 parent 87aa565 commit 3b91cc2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 6 additions & 0 deletions internal/command/wireguard/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ func newWireguardCreate() *cobra.Command {
command.RequireSession,
)
cmd.Args = cobra.MaximumNArgs(4)
flag.Add(cmd,
flag.String{
Name: "network",
Description: "Custom network name",
},
)
return cmd
}

Expand Down
3 changes: 1 addition & 2 deletions internal/command/wireguard/wireguard.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ func runWireguardCreate(ctx context.Context) error {
name = args[2]
}

// TODO: allow custom network
network := ""
network := flag.GetString(ctx, "network")

state, err := wireguard.Create(apiClient, org, region, name, network, "static")
if err != nil {
Expand Down

0 comments on commit 3b91cc2

Please sign in to comment.