Skip to content

Commit

Permalink
Add deprecation warnings, hide long deprecated commands
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldwan committed Aug 29, 2023
1 parent f193966 commit 6021e72
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/command/create/create.go
Expand Up @@ -10,7 +10,7 @@ func New() (cmd *cobra.Command) {
cmd = &cobra.Command{
Use: "create",
Hidden: true,
Deprecated: "replaced by 'apps create'",
Deprecated: "use `fly apps create` instead",
}

flag.Add(cmd,
Expand Down
2 changes: 2 additions & 0 deletions internal/command/curl/curl.go
Expand Up @@ -37,6 +37,8 @@ func New() (cmd *cobra.Command) {
cmd = command.New("curl <URL>", short, long, run,
command.RequireSession,
)
cmd.Deprecated = "`fly curl` will be removed in a future release"
cmd.Hidden = true

cmd.Args = cobra.ExactArgs(1)

Expand Down
2 changes: 2 additions & 0 deletions internal/command/destroy/destroy.go
Expand Up @@ -20,6 +20,8 @@ from the Fly platform.

destroy := command.New(usage, short, long, apps.RunDestroy,
command.RequireSession)
destroy.Hidden = true
destroy.Deprecated = "use `fly apps destroy` instead"

destroy.Args = cobra.ExactArgs(1)

Expand Down
5 changes: 5 additions & 0 deletions internal/command/dnsrecords/root.go
Expand Up @@ -24,6 +24,8 @@ func New() *cobra.Command {
long = "Manage DNS records within a domain"
)
cmd := command.New("dns-records", short, long, nil)
cmd.Deprecated = "`fly dns-records` will be removed in a future release"
cmd.Hidden = true
cmd.AddCommand(
newDNSRecordsList(),
newDNSRecordsExport(),
Expand All @@ -40,6 +42,7 @@ func newDNSRecordsList() *cobra.Command {
cmd := command.New("list <domain>", short, long, runDNSRecordsList,
command.RequireSession,
)
cmd.Deprecated = "`fly dns-records list` will be removed in a future release"
flag.Add(cmd,
flag.JSONOutput(),
)
Expand All @@ -55,6 +58,7 @@ func newDNSRecordsExport() *cobra.Command {
cmd := command.New("export <domain> [filename]", short, long, runDNSRecordsExport,
command.RequireSession,
)
cmd.Deprecated = "`fly dns-records export` will be removed in a future release"
cmd.Args = cobra.RangeArgs(1, 2)
return cmd
}
Expand All @@ -67,6 +71,7 @@ func newDNSRecordsImport() *cobra.Command {
cmd := command.New("import <domain> [filename]", short, long, runDNSRecordsImport,
command.RequireSession,
)
cmd.Deprecated = "`fly dns-records import` will be removed in a future release"
cmd.Args = cobra.RangeArgs(1, 2)
return cmd
}
Expand Down
2 changes: 2 additions & 0 deletions internal/command/domains/root.go
Expand Up @@ -28,6 +28,8 @@ Notice: this feature is deprecated and no longer supported.
You can still view existing domains, but registration is no longer possible.`
)
cmd := command.New("domains", short, long, nil)
cmd.Deprecated = "`fly domains` will be removed in a future release"
cmd.Hidden = true
cmd.AddCommand(
newDomainsList(),
newDomainsShow(),
Expand Down
2 changes: 2 additions & 0 deletions internal/command/move/move.go
Expand Up @@ -20,6 +20,8 @@ organization the current user belongs to.

move := command.New(usage, short, long, apps.RunMove,
command.RequireSession)
move.Hidden = true
move.Deprecated = "use `fly apps move` instead"

move.Args = cobra.ExactArgs(1)

Expand Down
5 changes: 4 additions & 1 deletion internal/command/open/open.go
Expand Up @@ -8,5 +8,8 @@ import (

// TODO: deprecate
func New() *cobra.Command {
return apps.NewOpen()
cmd := apps.NewOpen()
cmd.Deprecated = "use `fly apps open` instead"
cmd.Hidden = true
return cmd
}
2 changes: 2 additions & 0 deletions internal/command/resume/resume.go
Expand Up @@ -21,6 +21,8 @@ the number of configured instances.

resume := command.New(usage, short, long, apps.RunResume,
command.RequireSession)
resume.Hidden = true
resume.Deprecated = "use `fly scale count` instead"

resume.Args = cobra.ExactArgs(1)

Expand Down
2 changes: 2 additions & 0 deletions internal/command/suspend/suspend.go
Expand Up @@ -21,6 +21,8 @@ for details on restarting it.

suspend := command.New(usage, short, long, apps.RunSuspend,
command.RequireSession)
suspend.Hidden = true
suspend.Deprecated = "use `fly scale count` instead"

return suspend
}

0 comments on commit 6021e72

Please sign in to comment.