common-cli: arguments parsing improvement

Probably also want to add a test here for testing what input matches which command patterns. I think I originally did the matching based on the command pattern prefix before the first argument (e.g. "greet " for "greet <user>"), and I don't think I saw any changes to that.