Skip to content

Commit 10bf8ca

Browse files
author
Nathan Rebours
committed
Make the alias configurable in ocp-indent-gen-rules
Signed-off-by: Nathan Rebours <[email protected]>
1 parent 135f46a commit 10bf8ca

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ocp-indent-gen-rules/main.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
let exe_name = "ocp-indent-gen-rules"
22

33
let ignore = ref []
4+
let alias = ref "fmt"
45

56
let args =
67
[ ( "--ignore"
78
, Arg.String (fun s -> ignore := (String.split_on_char ',' s))
89
, "Comma separated list of files that should not be indented" )
10+
; ( "--alias"
11+
, Arg.Set_string alias
12+
, "The alias for the ocp-indent rules, default is fmt" )
913
]
1014

1115
let print_rules file =
@@ -21,7 +25,7 @@ let print_rules file =
2125
pf " (action (run ocp-indent %%{dep:../%s} -o %%{target})))" file;
2226
pf "";
2327
pf "(rule";
24-
pf " (alias fmt)";
28+
pf " (alias %s)" !alias;
2529
pf " (action (diff ../%s %s.%s)))" file file formatted_ext;
2630
pf ""
2731
| _ -> ()

0 commit comments

Comments
 (0)