From 45ca26dd14600c506eb86dd49cc1476cd3ff6701 Mon Sep 17 00:00:00 2001 From: Simon Richardson Date: Tue, 7 Jan 2020 15:43:43 +0000 Subject: [PATCH] Add the reason why we have IsSerial 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. --- cmd/juju/cloud/list.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cmd/juju/cloud/list.go b/cmd/juju/cloud/list.go index b6f57954c845..aa12f90cfdf8 100644 --- a/cmd/juju/cloud/list.go +++ b/cmd/juju/cloud/list.go @@ -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 {