Skip to content

Commit

Permalink
Add the reason why we have IsSerial
Browse files Browse the repository at this point in the history
The following adds a reason for the introduction of IsSerial. The basic
idea is that we want to provide a more holistic approach to handling the
formatting directives in the CLI without having to resorting to magic
string checking.
  • Loading branch information
SimonRichardson committed Jan 7, 2020
1 parent 5efe156 commit 6815d74
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cmd/juju/cloud/list.go
Expand Up @@ -175,10 +175,14 @@ func (c *listCloudsCommand) getCloudList(ctxt *cmd.Context) (*cloudList, error)
}

func (c *listCloudsCommand) Run(ctxt *cmd.Context) error {
// TODO: (stickupkid) IsSerial states that its machine is serialisable, we
// shouldn't prompt in those situations. In an ideal world we would move
// this into MaybePrompt, but the changes may have unintended consequences
// without proper understanding.
// TODO (stickupkid): IsSerial states that its machine is serialisable, we
// shouldn't prompt in those situations. This is a general clean up of how
// we handle formatting directives the user has requested.
// The aim is to provide a more holistic approach at the CLI, rather than
// magic string checking.
// In an ideal world we would move this into MaybePrompt, but the changes
// may have unintended consequences without proper understanding.
// See: https://discourse.jujucharms.com/t/cli-serialisable-output-formats/2490
// Should fix this for Juju 3.0
c.ReadOnly = ctxt.IsSerial()
if err := c.MaybePrompt(ctxt, "list clouds from"); err != nil {
Expand Down

0 comments on commit 6815d74

Please sign in to comment.