This repository was archived by the owner on Jul 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +6
-14
lines changed Expand file tree Collapse file tree 3 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ package cmd
2
2
3
3
import (
4
4
"fmt"
5
- "os"
6
5
"strings"
7
6
8
7
"github.com/docker/cli/cli"
@@ -20,12 +19,10 @@ var helmCmd = &cobra.Command{
20
19
for _ , v := range helmEnv {
21
20
kv := strings .SplitN (v , "=" , 2 )
22
21
if len (kv ) != 2 {
23
- fmt .Printf ("Missing '=' in setting '%s', expected KEY=VALUE\n " , v )
24
- os .Exit (1 )
22
+ return fmt .Errorf ("Missing '=' in setting '%s', expected KEY=VALUE" , v )
25
23
}
26
24
if _ , ok := d [kv [0 ]]; ok {
27
- fmt .Printf ("Duplicate command line setting: '%s'\n " , kv [0 ])
28
- os .Exit (1 )
25
+ return fmt .Errorf ("Duplicate command line setting: '%s'" , kv [0 ])
29
26
}
30
27
d [kv [0 ]] = kv [1 ]
31
28
}
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ package cmd
2
2
3
3
import (
4
4
"fmt"
5
- "os"
6
5
"strings"
7
6
8
7
"github.com/docker/lunchbox/image"
@@ -19,8 +18,7 @@ var imageAddCmd = &cobra.Command{
19
18
for _ , v := range imageAddEnv {
20
19
kv := strings .SplitN (v , "=" , 2 )
21
20
if len (kv ) != 2 {
22
- fmt .Printf ("Malformed env input: '%s'\n " , v )
23
- os .Exit (1 )
21
+ return fmt .Errorf ("Malformed env input: '%s'" , v )
24
22
}
25
23
d [kv [0 ]] = kv [1 ]
26
24
}
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ package cmd
2
2
3
3
import (
4
4
"fmt"
5
- "os"
6
5
"strings"
7
6
8
7
"github.com/docker/cli/cli"
@@ -28,12 +27,10 @@ Override is provided in different ways:
28
27
for _ , v := range renderEnv {
29
28
kv := strings .SplitN (v , "=" , 2 )
30
29
if len (kv ) != 2 {
31
- fmt .Printf ("Missing '=' in setting '%s', expected KEY=VALUE\n " , v )
32
- os .Exit (1 )
30
+ return fmt .Errorf ("Missing '=' in setting '%s', expected KEY=VALUE" , v )
33
31
}
34
32
if _ , ok := d [kv [0 ]]; ok {
35
- fmt .Printf ("Duplicate command line setting: '%s'\n " , kv [0 ])
36
- os .Exit (1 )
33
+ return fmt .Errorf ("Duplicate command line setting: '%s'" , kv [0 ])
37
34
}
38
35
d [kv [0 ]] = kv [1 ]
39
36
}
@@ -45,7 +42,7 @@ Override is provided in different ways:
45
42
if err != nil {
46
43
return err
47
44
}
48
- fmt .Printf ( "%s" , string (res ))
45
+ fmt .Print ( string (res ))
49
46
return nil
50
47
},
51
48
}
You can’t perform that action at this time.
0 commit comments