feat(cli): add git-aware CLI flags and validation
- Add ChangesOnly, Staged, Unstaged flags to CLI struct - Implement git flag validation with mutual exclusion rules - Add comprehensive flag compatibility checks - Update LLM guide with git workflow examples and documentation - Include test suite for CLI validation logic
This commit is contained in:
+13
-10
@@ -3,15 +3,18 @@ package types
|
||||
import "github.com/alecthomas/kong"
|
||||
|
||||
type CLI struct {
|
||||
Path string `arg:"" name:"path" help:"Source code file or directory to process" optional:""`
|
||||
Inline bool `help:"Remove only line comments"`
|
||||
Block bool `help:"Remove only block comments"`
|
||||
Recursive bool `short:"r" help:"Process directories recursively"`
|
||||
DryRun bool `help:"Show what would be removed without making changes"`
|
||||
Backup bool `help:"Create backup files before modification"`
|
||||
Verbose bool `help:"Show detailed output"`
|
||||
LLM bool `help:"Show LLM-friendly usage guide"`
|
||||
Version kong.VersionFlag `help:"Show version information"`
|
||||
Path string `arg:"" name:"path" help:"Source code file or directory to process" optional:""`
|
||||
Inline bool `help:"Remove only line comments"`
|
||||
Block bool `help:"Remove only block comments"`
|
||||
Recursive bool `short:"r" help:"Process directories recursively"`
|
||||
DryRun bool `help:"Show what would be removed without making changes"`
|
||||
Backup bool `help:"Create backup files before modification"`
|
||||
Verbose bool `help:"Show detailed output"`
|
||||
LLM bool `help:"Show LLM-friendly usage guide"`
|
||||
ChangesOnly bool `help:"Remove comments only from git changes (staged + unstaged + untracked)"`
|
||||
Staged bool `help:"Remove comments only from staged git changes"`
|
||||
Unstaged bool `help:"Remove comments only from unstaged git changes"`
|
||||
Version kong.VersionFlag `help:"Show version information"`
|
||||
}
|
||||
|
||||
type Language struct {
|
||||
@@ -22,4 +25,4 @@ type Language struct {
|
||||
type BlockComment struct {
|
||||
Start string
|
||||
End string
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user