@@ -54,7 +54,7 @@ def get_options(argv: Optional[list[str]] = None) -> argparse.ArgumentParser:
5454 )
5555 parser .add_argument (
5656 "-o" , "--output" , metavar = "<arg>" ,
57- help = "JSON output file (- for stdin )"
57+ help = "JSON output file (default=stdout )"
5858 )
5959 parser .add_argument (
6060 "-oc" , "--ocharset" , default = "utf-8" , metavar = "<arg>" ,
@@ -78,7 +78,7 @@ def get_options(argv: Optional[list[str]] = None) -> argparse.ArgumentParser:
7878 )
7979 parser .add_argument (
8080 "-it" , "--interactive" , default = False , action = "store_true" ,
81- help = "Interactive REPL"
81+ help = "Interactive REPL (requires input file) "
8282 )
8383
8484 # The expression
@@ -160,8 +160,9 @@ def main(argv: Optional[list[str]] = None) -> int:
160160 options = parser .parse_args (argv )
161161
162162 if options .expression is None and options .expr is None :
163- parser .print_help ()
164- return 1
163+ if not options .interactive :
164+ parser .print_help ()
165+ return 1
165166
166167 icharset = options .icharset
167168 ocharset = options .icharset
@@ -187,6 +188,9 @@ def main(argv: Optional[list[str]] = None) -> int:
187188 bindings = json .loads (bindings_str )
188189
189190 if options .input == '-' or options .input is None :
191+ if options .interactive :
192+ parser .print_help ()
193+ return 1
190194 input = sys .stdin .read ()
191195 else :
192196 with open (options .input , 'r' , encoding = icharset ) as fd :
0 commit comments