From b750234786bbc4f511b0e4fbf906c8b52e7bbe94 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 17 May 2021 02:21:25 +0530 Subject: Support implicit key pairing. * ccwl/ccwl.scm (command-syntax->object): When command accepts only a single input and there is only a single key available, support implicit key pairing. --- ccwl/ccwl.scm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ccwl/ccwl.scm b/ccwl/ccwl.scm index 7608d51..b139289 100644 --- a/ccwl/ccwl.scm +++ b/ccwl/ccwl.scm @@ -319,6 +319,21 @@ list of supplied input objects." ((tee expressions ...) (append-mapn (cut workflow-steps <> input-keys) #'(expressions ...))) + ;; commands with only a single input and when only a single key is + ;; available at this step + ((command (step-id)) + (and (command-variable #'command) + (= (length input-keys) 1) + (= (length (command-input-keys + (command-syntax->object #'command))) + 1)) + (workflow-steps #`(command (step-id) + #,(match (command-input-keys + (command-syntax->object #'command)) + ((command-key) (symbol->keyword command-key))) + #,(match input-keys + ((input-key) (key-name input-key)))) + input-keys)) ((command (step-id) args ...) ;; Run a whole bunch of tests so that we can produce useful error ;; messages. -- cgit v1.2.3