cli: Further refactor our input cli data

This commit is contained in:
James Shubin
2024-02-25 19:12:53 -05:00
parent 71c54ab212
commit 80af171a35
3 changed files with 21 additions and 20 deletions

View File

@@ -28,6 +28,15 @@ type Flags struct {
Verbose bool // add extra log message output
}
// Data is a struct of values that we usually pass to the main CLI function.
type Data struct {
Program string
Version string
Copying string
Flags Flags
Args []string // os.Args usually
}
// SafeProgram returns the correct program string when given a buggy variant.
func SafeProgram(program string) string {
// FIXME: in sub commands, the cli package appends a space and the sub