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 4bb53c6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 7 additions & 0 deletions internal/command/wireguard/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ func newWireguardCreate() *cobra.Command {
command.RequireSession,
)
cmd.Args = cobra.MaximumNArgs(4)
// Add flag for --network
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 4bb53c6

Please sign in to comment.