Skip to content

Commit 9300370

Browse files
ralphbeanclaude
andcommitted
Integrate outputOptions into embedding option sets
Update auditOpts and verifyCommitOptions to properly use the new outputOptions architecture methods instead of directly managing the format flag. - Call outputOptions.AddFlags() in both auditOpts and verifyCommitOptions - Call outputOptions.Validate() in both Validate() methods - Remove direct format flag registration from both files - Remove manual format initialization (now handled by AddFlags()) This completes the refactoring to follow the established command architecture pattern where option sets manage their own flags and validation through AddFlags() and Validate() methods. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> Signed-off-by: Ralph Bean <[email protected]>
1 parent 826f7aa commit 9300370

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

internal/cmd/audit.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,19 @@ func (ao *auditOpts) Validate() error {
102102
errs := []error{
103103
ao.branchOptions.Validate(),
104104
ao.verifierOptions.Validate(),
105+
ao.outputOptions.Validate(),
105106
}
106107
return errors.Join(errs...)
107108
}
108109

109110
func (ao *auditOpts) AddFlags(cmd *cobra.Command) {
110111
ao.branchOptions.AddFlags(cmd)
111112
ao.verifierOptions.AddFlags(cmd)
113+
ao.outputOptions.AddFlags(cmd)
112114
cmd.PersistentFlags().IntVar(&ao.auditDepth, "depth", 0, "The max number of revisions to audit (depth <= audit all revisions).")
113115
cmd.PersistentFlags().StringVar(&ao.endingCommit, "ending-commit", "", "The commit to stop auditing at.")
114116
ao.auditMode = AuditModeBasic
115117
cmd.PersistentFlags().Var(&ao.auditMode, "audit-mode", "'basic' for limited details (default), 'full' for all details")
116-
ao.format = OutputFormatText
117-
cmd.PersistentFlags().StringVar(&ao.format, "format", OutputFormatText, "Output format: 'text' (default) or 'json'")
118118
}
119119

120120
func addAudit(parentCmd *cobra.Command) {

internal/cmd/verifycommit.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,18 @@ func (vco *verifyCommitOptions) Validate() error {
4545
errs := []error{
4646
vco.commitOptions.Validate(),
4747
vco.verifierOptions.Validate(),
48+
vco.outputOptions.Validate(),
4849
}
4950
return errors.Join(errs...)
5051
}
5152

5253
func (vco *verifyCommitOptions) AddFlags(cmd *cobra.Command) {
5354
vco.commitOptions.AddFlags(cmd)
5455
vco.verifierOptions.AddFlags(cmd)
56+
vco.outputOptions.AddFlags(cmd)
5557
cmd.PersistentFlags().StringVar(
5658
&vco.tag, "tag", "", "The tag within the repository",
5759
)
58-
vco.format = OutputFormatText
59-
cmd.PersistentFlags().StringVar(&vco.format, "format", OutputFormatText, "Output format: 'text' (default) or 'json'")
6060
}
6161

6262
//nolint:dupl

0 commit comments

Comments
 (0)