{"action":"created","issue":{"url":"https://api.github.com/repos/docopt/docopt.R/issues/24","repository_url":"https://api.github.com/repos/docopt/docopt.R","labels_url":"https://api.github.com/repos/docopt/docopt.R/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/docopt/docopt.R/issues/24/comments","events_url":"https://api.github.com/repos/docopt/docopt.R/issues/24/events","html_url":"https://github.com/docopt/docopt.R/issues/24","id":176065798,"number":24,"title":"Required options resulting in error","user":{"login":"zkamvar","id":3639446,"avatar_url":"https://avatars.githubusercontent.com/u/3639446?v=3","gravatar_id":"","url":"https://api.github.com/users/zkamvar","html_url":"https://github.com/zkamvar","followers_url":"https://api.github.com/users/zkamvar/followers","following_url":"https://api.github.com/users/zkamvar/following{/other_user}","gists_url":"https://api.github.com/users/zkamvar/gists{/gist_id}","starred_url":"https://api.github.com/users/zkamvar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zkamvar/subscriptions","organizations_url":"https://api.github.com/users/zkamvar/orgs","repos_url":"https://api.github.com/users/zkamvar/repos","events_url":"https://api.github.com/users/zkamvar/events{/privacy}","received_events_url":"https://api.github.com/users/zkamvar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-09T17:37:54Z","updated_at":"2016-12-06T20:41:40Z","closed_at":null,"body":"I found some strange behavior where required options results in an error:\n\n``` r\n'usage: my_program.R [-a -r -m <msg>] <file>\n\noptions:\n -a         Add\n -r         Remote\n -m <msg>   Message' -> doc\n\ndocopt(doc)\n\n## Error: \n##  usage: my_program.R [-a -r -m <msg>] <file>\n```\n\nIt's fixed if you place it as an optional argument:\n\n``` r\n'usage: my_program.R [-a -r -m <msg>] [<file>]\n\noptions:\n -a         Add\n -r         Remote\n -m <msg>   Message' -> doc\n\ndocopt(doc)\n\n## List of 8\n##  $ -a    : logi FALSE\n##  $ -r    : logi FALSE\n##  $ -m    : NULL\n##  $ <file>: NULL\n##  $ a     : logi FALSE\n##  $ r     : logi FALSE\n##  $ m     : NULL\n##  $ file  : NULL\n## NULL\n\n```\n\nHere's the most MWE:\n\n``` r\n'usage: my_program.R <file>' -> doc\ndocopt(doc)\n## Error: \n##  usage: my_program.R <file>\n```\n\nSession Information:\n\n```\n> devtools::session_info()\nSession info -------------------------------------------------------------------------------------\n setting  value                       \n version  R version 3.3.1 (2016-06-21)\n system   x86_64, darwin13.4.0        \n ui       RStudio (1.0.8)             \n language (EN)                        \n collate  en_US.UTF-8                 \n tz       America/Los_Angeles         \n date     2016-09-09                  \n\nPackages -----------------------------------------------------------------------------------------\n package  * version date       source        \n devtools   1.12.0  2016-06-24 CRAN (R 3.3.0)\n digest     0.6.10  2016-08-02 CRAN (R 3.3.0)\n docopt   * 0.4.5   2016-06-13 CRAN (R 3.3.0)\n magrittr   1.5     2014-11-22 CRAN (R 3.2.0)\n memoise    1.0.0   2016-01-29 CRAN (R 3.2.3)\n stringi    1.1.1   2016-05-27 CRAN (R 3.3.0)\n stringr    1.0.0   2015-04-30 CRAN (R 3.2.0)\n withr      1.0.2   2016-06-20 cran (@1.0.2) \n```\n"},"comment":{"url":"https://api.github.com/repos/docopt/docopt.R/issues/comments/265266164","html_url":"https://github.com/docopt/docopt.R/issues/24#issuecomment-265266164","issue_url":"https://api.github.com/repos/docopt/docopt.R/issues/24","id":265266164,"user":{"login":"dbarowy","id":573142,"avatar_url":"https://avatars.githubusercontent.com/u/573142?v=3","gravatar_id":"","url":"https://api.github.com/users/dbarowy","html_url":"https://github.com/dbarowy","followers_url":"https://api.github.com/users/dbarowy/followers","following_url":"https://api.github.com/users/dbarowy/following{/other_user}","gists_url":"https://api.github.com/users/dbarowy/gists{/gist_id}","starred_url":"https://api.github.com/users/dbarowy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbarowy/subscriptions","organizations_url":"https://api.github.com/users/dbarowy/orgs","repos_url":"https://api.github.com/users/dbarowy/repos","events_url":"https://api.github.com/users/dbarowy/events{/privacy}","received_events_url":"https://api.github.com/users/dbarowy/received_events","type":"User","site_admin":false},"created_at":"2016-12-06T20:41:40Z","updated_at":"2016-12-06T20:41:40Z","body":"Seconded; please fix this bug.  The MWE that @zkamvar produced above was almost exactly my first stab at using `docopt.R`, which made me think that I was doing something wrong.  Glad I thought to check the issue tracker."}}
{"actor":{"display_login":"dbarowy"}}