fix: add missing cmd/shush/main.go and update gitignore

This commit is contained in:
carraes
2025-07-03 14:26:20 -03:00
parent 37bbe92319
commit 406dc32879
2 changed files with 37 additions and 1 deletions
+35
View File
@@ -0,0 +1,35 @@
package main
import (
"fmt"
"os"
"github.com/alecthomas/kong"
"github.com/carlosarraes/shush/internal/processor"
"github.com/carlosarraes/shush/internal/types"
)
var version = "0.1.0"
func main() {
var cli types.CLI
kong.Parse(&cli,
kong.Description("Remove comments from source code files"),
kong.Vars{"version": version})
if cli.Path == "" {
fmt.Fprintf(os.Stderr, "Error: path argument is required\n")
os.Exit(1)
}
if cli.Inline && cli.Block {
fmt.Fprintf(os.Stderr, "Error: --inline and --block flags are mutually exclusive\n")
os.Exit(1)
}
proc := processor.New(cli)
if err := proc.Process(); err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
}
}