mirror of
https://github.com/alvierahman90/otfmacros.git
synced 2025-01-05 20:41:59 +00:00
Add silent option
This commit is contained in:
parent
0b5db86c83
commit
ffaf0b0dc5
5
pymacro
5
pymacro
@ -13,6 +13,7 @@ def get_args():
|
|||||||
import argparse
|
import argparse
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("-m", "--macros", default=["macros"], action="append")
|
parser.add_argument("-m", "--macros", default=["macros"], action="append")
|
||||||
|
parser.add_argument("-s", "--silent", default=False, action="store_true")
|
||||||
parser.add_argument("input")
|
parser.add_argument("input")
|
||||||
parser.add_argument("output")
|
parser.add_argument("output")
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
@ -149,7 +150,9 @@ def main(args):
|
|||||||
# show and save output
|
# show and save output
|
||||||
with open(args.output, 'w+') as file:
|
with open(args.output, 'w+') as file:
|
||||||
file.write(output)
|
file.write(output)
|
||||||
print(output)
|
|
||||||
|
if not args.silent:
|
||||||
|
print(output)
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user