@@ -17,7 +17,7 @@ import (
1717)
1818
1919// ConfigList lists an app's config.
20- func (d * DeisCmd ) ConfigList (appID string , oneLine bool ) error {
20+ func (d * DeisCmd ) ConfigList (appID string , format string ) error {
2121 s , appID , err := load (d .ConfigFile , appID )
2222
2323 if err != nil {
@@ -31,16 +31,23 @@ func (d *DeisCmd) ConfigList(appID string, oneLine bool) error {
3131
3232 keys := sortKeys (config .Values )
3333
34- if oneLine {
34+ var configOutput * bytes.Buffer = new (bytes.Buffer )
35+
36+ switch format {
37+ case "oneline" :
3538 for i , key := range keys {
3639 sep := " "
3740 if i == len (keys )- 1 {
3841 sep = "\n "
3942 }
40- d . Printf ( "%s=%s%s" , key , config .Values [key ], sep )
43+ fmt . Fprintf ( configOutput , "%s=%s%s" , key , config .Values [key ], sep )
4144 }
42- } else {
43- d .Printf ("=== %s Config\n " , appID )
45+ case "diff" :
46+ for _ , key := range keys {
47+ fmt .Fprintf (configOutput , "%s=%s\n " , key , config .Values [key ])
48+ }
49+ default :
50+ fmt .Fprintf (configOutput , "=== %s Config\n " , appID )
4451
4552 configMap := make (map [string ]string )
4653
@@ -49,9 +56,10 @@ func (d *DeisCmd) ConfigList(appID string, oneLine bool) error {
4956 configMap [key ] = fmt .Sprintf ("%v" , config .Values [key ])
5057 }
5158
52- d . Print ( prettyprint .PrettyTabs (configMap , 6 ))
59+ fmt . Fprint ( configOutput , prettyprint .PrettyTabs (configMap , 6 ))
5360 }
5461
62+ d .Print (configOutput )
5563 return nil
5664}
5765
@@ -119,7 +127,7 @@ to set up healthchecks. This functionality has been deprecated. In the future, p
119127 d .Print ("done\n \n " )
120128 }
121129
122- return d .ConfigList (appID , false )
130+ return d .ConfigList (appID , "" )
123131}
124132
125133// ConfigUnset removes a config variable from an app.
@@ -153,7 +161,7 @@ func (d *DeisCmd) ConfigUnset(appID string, configVars []string) error {
153161
154162 d .Print ("done\n \n " )
155163
156- return d .ConfigList (appID , false )
164+ return d .ConfigList (appID , "" )
157165}
158166
159167// ConfigPull pulls an app's config to a file.
0 commit comments