The tricky part is knowing which input will be first. Knowing that requires parsing/pattern matching the template, and inspecting the options. Perhaps we can do that as a separate pull request?