Skip to content
Snippets Groups Projects
Verified Commit 60a6e795 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

feat new method to get the output of the flags

parent 5e3b00ca
No related branches found
No related tags found
No related merge requests found
......@@ -24,10 +24,16 @@ func Execute[C any](cmd C) *Settings[C] {
return execute(cmd, noShadow{}, os.Args[0], os.Args[1:])
}
// PrintFlagOutput prints the flag output to the standard output.
func (s *Settings[C]) PrintFlagOutput() {
fmt.Println(s.command.flagSet.Output())
}
// GetFlagOutput returns the flag output.
func (s *Settings[C]) GetFlagOutput() {
fmt.Println(s.command.flagSet.Output())
}
// execute is the internal implementation of ExecuteWithShadow.
func execute[C any, D any](cmd C, cnf D, name string, args []string) *Settings[C] {
instance := New(name, cmd)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment