Skip to content

Commit d24da26

Browse files
committed
Add --output-file argument to mkstyle
1 parent ec5e1a5 commit d24da26

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/mkstyle

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22

3+
import argparse
34
import json
45
import math
56
import sys
@@ -34,7 +35,16 @@ def myround(x, y):
3435
# Internals
3536
format_pc = partial(myround, y=digits + 1)
3637
format_class = partial(myround, y=digits)
37-
outfp = Path(sys.argv[0]).parent.resolve() / "style.css"
38+
39+
40+
def parse_arguments():
41+
parser = argparse.ArgumentParser()
42+
parser.add_argument("--output-file", action="store", default="style.css")
43+
return parser.parse_args()
44+
45+
46+
args = parse_arguments()
47+
outfp = args.output_file
3848
print(f"Writing output to {outfp}")
3949

4050
outfh = open(outfp, "w", encoding="utf8")

0 commit comments

Comments
 (0)