{"action":"created","issue":{"url":"https://api.github.com/repos/datafolklabs/cement/issues/205","labels_url":"https://api.github.com/repos/datafolklabs/cement/issues/205/labels{/name}","comments_url":"https://api.github.com/repos/datafolklabs/cement/issues/205/comments","events_url":"https://api.github.com/repos/datafolklabs/cement/issues/205/events","html_url":"https://github.com/datafolklabs/cement/issues/205","id":20833829,"number":205,"title":"Add support for groups of arguments.","user":{"login":"Kentzo","id":88809,"avatar_url":"https://avatars.githubusercontent.com/u/88809?v=3","gravatar_id":"","url":"https://api.github.com/users/Kentzo","html_url":"https://github.com/Kentzo","followers_url":"https://api.github.com/users/Kentzo/followers","following_url":"https://api.github.com/users/Kentzo/following{/other_user}","gists_url":"https://api.github.com/users/Kentzo/gists{/gist_id}","starred_url":"https://api.github.com/users/Kentzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kentzo/subscriptions","organizations_url":"https://api.github.com/users/Kentzo/orgs","repos_url":"https://api.github.com/users/Kentzo/repos","events_url":"https://api.github.com/users/Kentzo/events{/privacy}","received_events_url":"https://api.github.com/users/Kentzo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/datafolklabs/cement/labels/dev/2.7.x","name":"dev/2.7.x","color":"DDDDDD"},{"url":"https://api.github.com/repos/datafolklabs/cement/labels/feature","name":"feature","color":"02e10c"}],"state":"closed","locked":false,"assignee":{"login":"derks","id":130503,"avatar_url":"https://avatars.githubusercontent.com/u/130503?v=3","gravatar_id":"","url":"https://api.github.com/users/derks","html_url":"https://github.com/derks","followers_url":"https://api.github.com/users/derks/followers","following_url":"https://api.github.com/users/derks/following{/other_user}","gists_url":"https://api.github.com/users/derks/gists{/gist_id}","starred_url":"https://api.github.com/users/derks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derks/subscriptions","organizations_url":"https://api.github.com/users/derks/orgs","repos_url":"https://api.github.com/users/derks/repos","events_url":"https://api.github.com/users/derks/events{/privacy}","received_events_url":"https://api.github.com/users/derks/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/datafolklabs/cement/milestones/24","html_url":"https://github.com/datafolklabs/cement/milestones/2.8.0%20Stable","labels_url":"https://api.github.com/repos/datafolklabs/cement/milestones/24/labels","id":1108766,"number":24,"title":"2.8.0 Stable","description":"","creator":{"login":"derks","id":130503,"avatar_url":"https://avatars.githubusercontent.com/u/130503?v=3","gravatar_id":"","url":"https://api.github.com/users/derks","html_url":"https://github.com/derks","followers_url":"https://api.github.com/users/derks/followers","following_url":"https://api.github.com/users/derks/following{/other_user}","gists_url":"https://api.github.com/users/derks/gists{/gist_id}","starred_url":"https://api.github.com/users/derks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derks/subscriptions","organizations_url":"https://api.github.com/users/derks/orgs","repos_url":"https://api.github.com/users/derks/repos","events_url":"https://api.github.com/users/derks/events{/privacy}","received_events_url":"https://api.github.com/users/derks/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":1,"state":"open","created_at":"2015-05-13T15:06:16Z","updated_at":"2015-06-18T22:30:50Z","due_on":null,"closed_at":null},"comments":27,"created_at":"2013-10-10T20:38:12Z","updated_at":"2015-06-18T22:39:12Z","closed_at":"2015-06-18T22:30:50Z","body":"Argparse supports grouping of arguments for better help message so cement should.\r\n\r\nCurrent workaround is to override `_process_arguments`\r\n\r\n<!---\r\n@huboard:{\"order\":205.0,\"milestone_order\":205,\"custom_state\":\"\"}\n-->\r\n"},"comment":{"url":"https://api.github.com/repos/datafolklabs/cement/issues/comments/113306846","html_url":"https://github.com/datafolklabs/cement/issues/205#issuecomment-113306846","issue_url":"https://api.github.com/repos/datafolklabs/cement/issues/205","id":113306846,"user":{"login":"derks","id":130503,"avatar_url":"https://avatars.githubusercontent.com/u/130503?v=3","gravatar_id":"","url":"https://api.github.com/users/derks","html_url":"https://github.com/derks","followers_url":"https://api.github.com/users/derks/followers","following_url":"https://api.github.com/users/derks/following{/other_user}","gists_url":"https://api.github.com/users/derks/gists{/gist_id}","starred_url":"https://api.github.com/users/derks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derks/subscriptions","organizations_url":"https://api.github.com/users/derks/orgs","repos_url":"https://api.github.com/users/derks/repos","events_url":"https://api.github.com/users/derks/events{/privacy}","received_events_url":"https://api.github.com/users/derks/received_events","type":"User","site_admin":false},"created_at":"2015-06-18T22:39:12Z","updated_at":"2015-06-18T22:39:12Z","body":"I have been reading more up on argument groups in Argparse, and though this new controller does not directly interact with that it does provide the means to do so.\r\n\r\n```python\r\n\r\nfrom cement.ext.ext_argparse import ArgparseController, expose\r\n\r\nclass MyController(ArgparseController):\r\n    class Meta:\r\n        label = 'base'\r\n\r\n        # add simple argument the same old way\r\n        arguments = [\r\n            (['-f', '--foo'], dict(help='my foo option', dest='foo'),\r\n        ]\r\n\r\n    def _pre_argument_parsing(self):\r\n        group1 = self.parser.add_argument_group('my-special-group')\r\n        group1.add_argument('--g1', help='my g1 option under my-special-group', dest='g1')\r\n        group1.add_argument('--g2', help='my g2 option under my-special-group', dest='g2')\r\n\r\n        # or mutually exclusive groups\r\n        meg = self.parser.add_mutually_exclusive_group()\r\n        meg.add_argument('--g3', help='my g3 option')\r\n        meg.add_argument('--g4', help='my g4 option')\r\n```\r\n\r\nThe above is untested example, but essentially in `_pre_argument_parsing` you can have full access to the sub parser for that controller... and do anything you would normally do with Argparse.\r\n\r\nThat said, there is currently no way to do this with controller sub-command arguments.  in the future, it would be nice to have the framework support groups better, but this will atleast make it possible."}}