feat: wogihrsoiuvjsroirgj

This commit is contained in:
2025-12-24 14:55:33 -05:00
parent 1d8ecba118
commit 2c3ce9baf7
8 changed files with 204 additions and 26 deletions

28
internal/cli/arguments.go Normal file
View File

@@ -0,0 +1,28 @@
package cli
import (
"flag"
"fmt"
)
type CLIOptions struct {
Input string
Verbose bool
}
func ParseOptions(args []string) (*CLIOptions, error) {
// Parse flags and arguments.
verbose := flag.Bool("v", false, "Verbosity. If set, the program will print logs.")
flag.Parse()
if flag.NArg() == 0 {
return nil, fmt.Errorf("No input given.")
} else if flag.NArg() > 1 {
return nil, fmt.Errorf("More than 1 command-line argument.")
}
return &CLIOptions{
Input: flag.Arg(0),
Verbose: *verbose,
}, nil
}