-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Clean up log & version flags
Signed-off-by: Justin Toh <tohjustin@hotmail.com>
- Loading branch information
Showing
4 changed files
with
22 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/tohjustin/kube-lineage/internal/log" | ||
"github.com/tohjustin/kube-lineage/internal/version" | ||
) | ||
|
||
func addLogFlags(cmd *cobra.Command) { | ||
log.AddFlags(cmd.Flags()) | ||
} | ||
|
||
func addVersionFlags(cmd *cobra.Command) { | ||
cmd.SetVersionTemplate("{{printf \"%s\" .Version}}\n") | ||
cmd.Version = fmt.Sprintf("%#v", version.Get()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters