{"action":"reopened","issue":{"url":"https://api.github.com/repos/pcapriotti/optparse-applicative/issues/220","repository_url":"https://api.github.com/repos/pcapriotti/optparse-applicative","labels_url":"https://api.github.com/repos/pcapriotti/optparse-applicative/issues/220/labels{/name}","comments_url":"https://api.github.com/repos/pcapriotti/optparse-applicative/issues/220/comments","events_url":"https://api.github.com/repos/pcapriotti/optparse-applicative/issues/220/events","html_url":"https://github.com/pcapriotti/optparse-applicative/issues/220","id":170452680,"number":220,"title":"Nested usage info for dependent options?","user":{"login":"sjakobi","id":3664523,"avatar_url":"https://avatars.githubusercontent.com/u/3664523?v=3","gravatar_id":"","url":"https://api.github.com/users/sjakobi","html_url":"https://github.com/sjakobi","followers_url":"https://api.github.com/users/sjakobi/followers","following_url":"https://api.github.com/users/sjakobi/following{/other_user}","gists_url":"https://api.github.com/users/sjakobi/gists{/gist_id}","starred_url":"https://api.github.com/users/sjakobi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjakobi/subscriptions","organizations_url":"https://api.github.com/users/sjakobi/orgs","repos_url":"https://api.github.com/users/sjakobi/repos","events_url":"https://api.github.com/users/sjakobi/events{/privacy}","received_events_url":"https://api.github.com/users/sjakobi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-10T15:53:56Z","updated_at":"2016-08-11T06:39:51Z","closed_at":null,"body":"Take an option structure like this:\r\n\r\n```\r\ndata Opts = Opts\r\n  { a :: String\r\n  , b :: Maybe B\r\n  }\r\n\r\noptsParser :: Parser Opts\r\noptsParser = Opts\r\n  <$> strOption (long \"a\")\r\n  <*> optional bParser\r\n\r\ndata B = B\r\n  { b0 :: String\r\n  , b1 :: Maybe String\r\n  }\r\n\r\nbParser :: Parser B\r\nbParser = B\r\n  <$> strOption (long \"b0\")\r\n  <*> optional (strOption (long \"b1\"))\r\n\r\nmain :: IO ()\r\nmain =\r\n  void $ execParser\r\n    (info (helper <*> optsParser) fullDesc)\r\n```\r\n\r\nThe resulting usage info is\r\n\r\n```\r\nUsage: dependent-opts-exe --a ARG [--b0 ARG] [--b1 ARG]\r\n```\r\n\r\nThis usage info doesn't reveal that `--b1` can only be passed in if `--b0` is given. Therefore I would prefer to see \r\n\r\n```\r\nUsage: dependent-opts-exe --a ARG [--b0 ARG [--b1 ARG]]\r\n```\r\n\r\nIs this something that `optparse-applicative` could do?"}}
{"actor":{"display_login":"HuwCampbell"}}