@@ -2,7 +2,6 @@ package cmd
22
33import (
44 "context"
5- "log"
65 "os"
76 "strconv"
87
@@ -26,7 +25,7 @@ var getMetaRevisionCmd = &cobra.Command{
2625 },
2726 Run : func (cmd * cobra.Command , args []string ) {
2827 if len (args ) > 1 {
29- log . Fatalf ("argument at most one, got %d" , len (args ))
28+ exitf ("argument at most one, got %d" , len (args ))
3029 }
3130
3231 ctx := context .Background ()
@@ -38,26 +37,26 @@ var getMetaRevisionCmd = &cobra.Command{
3837 if getRevisionOpt .groupName != nil {
3938 group , err := oomStore .GetGroupByName (ctx , * getRevisionOpt .groupName )
4039 if err != nil {
41- log . Fatalf ("failed to get feature group name=%s: %+v" , * getRevisionOpt .groupName , err )
40+ exitf ("failed to get feature group name=%s: %+v" , * getRevisionOpt .groupName , err )
4241 }
4342 groupID = & group .ID
4443 }
4544
4645 revisions , err := oomStore .ListRevision (ctx , groupID )
4746 if err != nil {
48- log . Fatalf ("failed geting revisions, error %+v\n " , err )
47+ exitf ("failed geting revisions, error %+v\n " , err )
4948 }
5049
5150 if len (args ) > 0 {
5251 if revisions = revisions .Filter (func (r * types.Revision ) bool {
5352 return strconv .Itoa (r .ID ) == args [0 ]
5453 }); len (revisions ) == 0 {
55- log . Fatalf ("revision '%s' not found" , args [0 ])
54+ exitf ("revision '%s' not found" , args [0 ])
5655 }
5756 }
5857
5958 if err := serializeMetadata (os .Stdout , revisions , * getMetaOutput , * getMetaWide ); err != nil {
60- log . Fatalf ("failed printing entities, error %+v\n " , err )
59+ exitf ("failed printing entities, error %+v\n " , err )
6160 }
6261 },
6362}
0 commit comments