I am trying to find a way to write a command with options that can take additional options. The additional options can also apply to the command itself, but if expressed in a certain way, will be applied in a nested fashion.
For example, the syntax I am looking for would be something like the following (lines split for readability):
getFolks --name Bob --computers MacbookPro='123ABC'
Macbook ThinkPad='123EFG'[ --components 'ram>=10' ]
--components screenres='1440x900|1920x1080'
This is eventually going to be converted into a mysql query, and should be read like this:
"Get folks named Bob who have a ( MacbookPro with serial number 123ABC ), and a ( Macbook (any serial numbers ok) ), and a ( Thinkpad with serial number 123EFG with ram greater than or equal to 10 ) and all computers must have screen resolution of 1440x1260 or screen resolution of 1920x180.
I am trying to accomplish this without having to make "computers" become a sub command, since the --components option would be the same for both. Open to any suggestions however. Thanks for any ideas!