@@ -655,17 +655,28 @@ enum Commands {
655655 args : Vec < String > ,
656656 } ,
657657
658- /// gcc/g++ compiler with grouped error output (60-80% token savings)
659- ///
660- /// Strips verbose caret/source-snippet context lines and groups
661- /// diagnostics by file. Errors show file + line + message; warnings
662- /// are summarised by file. Works with gcc, g++, and clang.
658+ /// gcc compiler with grouped error output (60-80% token savings)
663659 Gcc {
664- /// Compiler binary to invoke (gcc, g++, clang, clang++)
665- #[ arg( default_value = "gcc" ) ]
666- compiler : String ,
660+ #[ arg( trailing_var_arg = true , allow_hyphen_values = true ) ]
661+ args : Vec < String > ,
662+ } ,
663+
664+ /// g++ compiler with grouped error output (60-80% token savings)
665+ #[ command( name = "g++" ) ]
666+ Gxx {
667+ #[ arg( trailing_var_arg = true , allow_hyphen_values = true ) ]
668+ args : Vec < String > ,
669+ } ,
667670
668- /// Compiler arguments (source files, flags, …)
671+ /// clang compiler with grouped error output (60-80% token savings)
672+ Clang {
673+ #[ arg( trailing_var_arg = true , allow_hyphen_values = true ) ]
674+ args : Vec < String > ,
675+ } ,
676+
677+ /// clang++ compiler with grouped error output (60-80% token savings)
678+ #[ command( name = "clang++" ) ]
679+ Clangxx {
669680 #[ arg( trailing_var_arg = true , allow_hyphen_values = true ) ]
670681 args : Vec < String > ,
671682 } ,
@@ -2065,8 +2076,17 @@ fn main() -> Result<()> {
20652076 golangci_cmd:: run ( & args, cli. verbose ) ?;
20662077 }
20672078
2068- Commands :: Gcc { compiler, args } => {
2069- gcc_cmd:: run ( & compiler, & args, cli. verbose ) ?;
2079+ Commands :: Gcc { args } => {
2080+ gcc_cmd:: run ( "gcc" , & args, cli. verbose ) ?;
2081+ }
2082+ Commands :: Gxx { args } => {
2083+ gcc_cmd:: run ( "g++" , & args, cli. verbose ) ?;
2084+ }
2085+ Commands :: Clang { args } => {
2086+ gcc_cmd:: run ( "clang" , & args, cli. verbose ) ?;
2087+ }
2088+ Commands :: Clangxx { args } => {
2089+ gcc_cmd:: run ( "clang++" , & args, cli. verbose ) ?;
20702090 }
20712091
20722092 Commands :: HookAudit { since } => {
@@ -2289,6 +2309,9 @@ fn is_operational_command(cmd: &Commands) -> bool {
22892309 | Commands :: GolangciLint { .. }
22902310 | Commands :: Gt { .. }
22912311 | Commands :: Gcc { .. }
2312+ | Commands :: Gxx { .. }
2313+ | Commands :: Clang { .. }
2314+ | Commands :: Clangxx { .. }
22922315 )
22932316}
22942317
0 commit comments