WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit ed896b9

Browse files
zechen0alexellis
authored andcommitted
Set flag pro by reading both --tcp and --pro
The pro flag is used to enable pro-specific options such as opening all ports. The --pro command line arg is deprecated in favor of --tcp. We keep both for now but will remove --pro in the future. Signed-off-by: Ze Chen <[email protected]>
1 parent 40a4e4f commit ed896b9

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

cmd/create.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ func init() {
4343
createCmd.Flags().String("subscription-id", "", "Subscription ID (Azure)")
4444

4545
createCmd.Flags().Bool("tcp", true, `Provision an exit-server with inlets PRO running as a TCP server`)
46-
46+
createCmd.Flags().Bool("pro", true, `Provision an exit-server with inlets PRO (Deprecated)`)
47+
_ = createCmd.Flags().MarkHidden("pro")
4748
createCmd.Flags().DurationP("poll", "n", time.Second*2, "poll every N seconds, use a higher value if you encounter rate-limiting")
4849
}
4950

@@ -190,10 +191,14 @@ func runCreate(cmd *cobra.Command, _ []string) error {
190191
if err != nil {
191192
return err
192193
}
193-
var pro bool
194194

195-
if v, _ := cmd.Flags().GetBool("pro"); v {
196-
pro = true
195+
pro := true
196+
if cmd.Flags().Changed("pro") {
197+
fmt.Printf("WARN: --pro is deprecated, use --tcp instead.")
198+
pro, _ = cmd.Flags().GetBool("pro")
199+
}
200+
if cmd.Flags().Changed("tcp") {
201+
pro, _ = cmd.Flags().GetBool("tcp")
197202
}
198203

199204
name := strings.Replace(names.GetRandomName(10), "_", "-", -1)

0 commit comments

Comments
 (0)