From cec60f895c881aaa05e16fa9c81fd1bf6b7e780b Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Thu, 9 Nov 2023 11:02:53 +0100 Subject: [PATCH] chore(cmd/driver): print quoted strings in `printenv`. Signed-off-by: Federico Di Pierro --- cmd/driver/printenv/printenv.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/driver/printenv/printenv.go b/cmd/driver/printenv/printenv.go index 474c0b10..788d6f12 100644 --- a/cmd/driver/printenv/printenv.go +++ b/cmd/driver/printenv/printenv.go @@ -55,10 +55,10 @@ func (o *driverPrintenvOptions) RunDriverPrintenv(_ context.Context) error { if err != nil { return err } - fmt.Printf("DRIVER=%s\n", driver.Type.String()) - fmt.Printf("DRIVERS_REPO=%s\n", strings.Join(driver.Repos, ",")) - fmt.Printf("DRIVER_VERSION=%s\n", driver.Version) - fmt.Printf("DRIVER_NAME=%s\n", driver.Name) + fmt.Printf("DRIVER=%q\n", driver.Type.String()) + fmt.Printf("DRIVERS_REPO=%q\n", strings.Join(driver.Repos, ",")) + fmt.Printf("DRIVER_VERSION=%q\n", driver.Version) + fmt.Printf("DRIVER_NAME=%q\n", driver.Name) kr, err := driverkernel.FetchInfo("", "") if err != nil { @@ -69,12 +69,12 @@ func (o *driverPrintenvOptions) RunDriverPrintenv(_ context.Context) error { if err != nil { return err } - fmt.Printf("TARGET_ID=%s\n", d.String()) + fmt.Printf("TARGET_ID=%q\n", d.String()) fixedKr := d.FixupKernel(kr) - fmt.Printf("ARCH=%s\n", fixedKr.Architecture.ToNonDeb()) - fmt.Printf("KERNEL_RELEASE=%s\n", fixedKr.String()) - fmt.Printf("KERNEL_VERSION=%s\n", fixedKr.KernelVersion) + fmt.Printf("ARCH=%q\n", fixedKr.Architecture.ToNonDeb()) + fmt.Printf("KERNEL_RELEASE=%q\n", fixedKr.String()) + fmt.Printf("KERNEL_VERSION=%q\n", fixedKr.KernelVersion) return nil }