Skip to content

Commit 29efc74

Browse files
fix naming of alias and add json check
1 parent 06d7658 commit 29efc74

15 files changed

Lines changed: 39 additions & 25 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
- feat(service/backend): moved the `backend` command under the `service` command, with an unlisted and deprecated alias of `backend` ([#1621](https://github.com/fastly/cli/pull/1621))
1919
- feat(service/backend): moved the `acl` and `aclentry` commands under the `service` command, with a unlisted and deprecated aliases of `acl` and `aclentry` ([#1621](https://github.com/fastly/cli/pull/1624))
2020
- feat(version): If the latest version is at least one major version higher than the current version, provide links to the release notes for the major version(s) so the user can review them before upgrading. ([#1623](https://github.com/fastly/cli/pull/1623))
21-
- feat(service/alert): moved the `alert` command under the `service` command, with an unlisted and deprecated alias of `alert` ([#1616](https://github.com/fastly/cli/pull/1626))
21+
- feat(service/alert): moved the `alerts` command to the `service alert` command, with an unlisted and deprecated alias of `alerts` ([#1616](https://github.com/fastly/cli/pull/1626))
2222

2323
### Bug fixes:
2424

pkg/commands/alias/acl/describe.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ func NewDescribeCommand(parent argparser.Registerer, g *global.Data) *DescribeCo
2424

2525
// Exec implements the command interface.
2626
func (c *DescribeCommand) Exec(in io.Reader, out io.Writer) error {
27-
text.Deprecated(out, "Use the 'service acl describe' command instead.")
27+
if !c.JSONOutput.Enabled {
28+
text.Deprecated(out, "Use the 'service acl describe' command instead.")
29+
}
2830
return c.DescribeCommand.Exec(in, out)
2931
}

pkg/commands/alias/acl/list.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ func NewListCommand(parent argparser.Registerer, g *global.Data) *ListCommand {
2424

2525
// Exec implements the command interface.
2626
func (c *ListCommand) Exec(in io.Reader, out io.Writer) error {
27-
text.Deprecated(out, "Use the 'service acl list' command instead.")
27+
if !c.JSONOutput.Enabled {
28+
text.Deprecated(out, "Use the 'service acl list' command instead.")
29+
}
2830
return c.ListCommand.Exec(in, out)
2931
}

pkg/commands/alias/aclentry/describe.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ func NewDescribeCommand(parent argparser.Registerer, g *global.Data) *DescribeCo
2424

2525
// Exec implements the command interface.
2626
func (c *DescribeCommand) Exec(in io.Reader, out io.Writer) error {
27-
text.Deprecated(out, "Use the 'service aclentry describe' command instead.")
27+
if !c.JSONOutput.Enabled {
28+
text.Deprecated(out, "Use the 'service aclentry describe' command instead.")
29+
}
2830
return c.DescribeCommand.Exec(in, out)
2931
}

pkg/commands/alias/aclentry/list.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ func NewListCommand(parent argparser.Registerer, g *global.Data) *ListCommand {
2424

2525
// Exec implements the command interface.
2626
func (c *ListCommand) Exec(in io.Reader, out io.Writer) error {
27-
text.Deprecated(out, "Use the 'service aclentry list' command instead.")
27+
if !c.JSONOutput.Enabled {
28+
text.Deprecated(out, "Use the 'service aclentry list' command instead.")
29+
}
2830
return c.ListCommand.Exec(in, out)
2931
}

pkg/commands/alias/alert/doc.go

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package alert
1+
package alerts
22

33
import (
44
"io"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package alert
1+
package alerts
22

33
import (
44
"io"
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package alert
1+
package alerts
22

33
import (
44
"io"
@@ -24,6 +24,8 @@ func NewDescribeCommand(parent argparser.Registerer, g *global.Data) *DescribeCo
2424

2525
// Exec implements the command interface.
2626
func (c *DescribeCommand) Exec(in io.Reader, out io.Writer) error {
27-
text.Deprecated(out, "Use the 'service alert describe' command instead.")
27+
if !c.JSONOutput.Enabled {
28+
text.Deprecated(out, "Use the 'service alert describe' command instead.")
29+
}
2830
return c.DescribeCommand.Exec(in, out)
2931
}

pkg/commands/alias/alerts/doc.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Package alerts contains deprecated aliases for the 'service alert' commands.
2+
package alerts

0 commit comments

Comments
 (0)