From c1c168728c2b26977bb563bb7e9f4fc89cfda30e Mon Sep 17 00:00:00 2001 From: James Norton Date: Thu, 16 May 2024 14:23:40 -0400 Subject: [PATCH] HARMONY-1764: Add --harmony-input-file flag for passing large operations --- harmony/cli.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/harmony/cli.py b/harmony/cli.py index 505ac0b..1912d2e 100644 --- a/harmony/cli.py +++ b/harmony/cli.py @@ -323,11 +323,16 @@ def run_cli(parser, args, AdapterClass, cfg=None): if args.harmony_wrap_stdout: setup_stdout_log_formatting(cfg) + # read in the operation file passed in with --harmony-input-file if any + if bool(args.harmony_input_file): + with open(args.harmony_input_file, 'r') as f: + args.harmony_input = f.read() + if args.harmony_action == 'invoke': start_time = datetime.datetime.now() if not bool(args.harmony_input): parser.error( - '--harmony-input must be provided for --harmony-action=invoke') + '--harmony-input or --harmony-input-file must be provided for --harmony-action=invoke') elif not bool(args.harmony_sources): successful = _invoke_deprecated(AdapterClass, args.harmony_input, cfg) if not successful: