File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -93,12 +93,13 @@ state any changes (for legal details please read LICENSE file).
9393#### show
9494
9595 Usage:
96- layout [OPTIONS] show <config-file>
96+ layout [OPTIONS] show <config | config -file>
9797
9898 Help Options:
9999 -h, --help Show this help message
100100
101101 Available commands:
102+ config current config
102103 config-file location of default config file
103104
104105#### new
Original file line number Diff line number Diff line change @@ -16,10 +16,16 @@ limitations under the License.
1616
1717package commands
1818
19- import "fmt"
19+ import (
20+ "fmt"
21+ "os"
22+
23+ "gopkg.in/yaml.v3"
24+ )
2025
2126type ShowCommand struct {
2227 ConfigFile ShowConfigFileCommand `command:"config-file" description:"location of default config file"`
28+ Config ShowConfigCommand `command:"config" description:"current config"`
2329}
2430
2531type ShowConfigFileCommand struct {
@@ -29,3 +35,15 @@ func (cmd ShowConfigFileCommand) Execute([]string) error {
2935 _ , err := fmt .Println (defaultConfigFile ())
3036 return err
3137}
38+
39+ type ShowConfigCommand struct {
40+ ConfigSource
41+ }
42+
43+ func (cmd ShowConfigCommand ) Execute ([]string ) error {
44+ c , err := cmd .readConfig ()
45+ if err != nil {
46+ return err
47+ }
48+ return yaml .NewEncoder (os .Stdout ).Encode (c )
49+ }
You can’t perform that action at this time.
0 commit comments