Skip to content

Commit

Permalink
Merge pull request #61 from mkumatag/hide_audit
Browse files Browse the repository at this point in the history
Hide audit-file option for image subcommand
  • Loading branch information
ltccci authored Dec 9, 2020
2 parents d863647 + 25030ba commit 309bc3a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ func init() {
rootCmd.PersistentFlags().SortFlags = false
_ = rootCmd.Flags().MarkHidden("debug")

// Hide the --audit-file for the image subcommand
// TODO: Remove this after adding audit support to image subcommand
origHelpFunc := rootCmd.HelpFunc()
rootCmd.SetHelpFunc(func(cmd *cobra.Command, args []string) {
if cmd.Name() == "image" || (cmd.Parent() != nil && cmd.Parent().Name() == "image") {
cmd.Flags().MarkHidden("audit-file")
}
origHelpFunc(cmd, args)
})

audit.Logger = audit.New(pkg.Options.AuditFile)
}

Expand Down

0 comments on commit 309bc3a

Please sign in to comment.