diff options
author | Özgür Kesim <oec@kesim.org> | 2025-03-17 19:36:20 +0100 |
---|---|---|
committer | Özgür Kesim <oec@kesim.org> | 2025-03-17 19:36:20 +0100 |
commit | d4154b2d347ef87a1e302ff706f775e1969f83ec (patch) | |
tree | 1b40317a098dc7c87e2371cd7971a1ff9546ce26 /uncrust.go | |
parent | 297f167aa009837c718aed52448255abdb1ddbb9 (diff) |
Diffstat (limited to 'uncrust.go')
-rw-r--r-- | uncrust.go | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -19,6 +19,7 @@ import ( var ( fl_lang = flag.String("l", "C", "Language") fl_verbose = flag.Bool("v", false, "Verbosity on") + fl_config = flag.String("c", os.Getenv("UNCRUSTIFY_CONFIG"), "uncrustify config") pos_rx = regexp.MustCompile(`.* orig line is ([\d]+), orig col is ([\d]+)`) lin_rx = regexp.MustCompile(`.* orig line is ([\d]+)`) @@ -49,7 +50,12 @@ func main() { log.Fatalf("couldn't read body of window id %d: %s\n", wid, e) } - args := []string{"--replace", "--no-backup", "-l", *fl_lang} + args := []string{} + if *fl_config != "" { + args = append(args, "-c", *fl_config) + } + args = append(args, "--no-backup", "-l", *fl_lang) + stderr := &bytes.Buffer{} stdout := &bytes.Buffer{} |