{"action":"created","issue":{"url":"https://api.github.com/repos/ygrek/ocaml-extlib/issues/3","labels_url":"https://api.github.com/repos/ygrek/ocaml-extlib/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/ygrek/ocaml-extlib/issues/3/comments","events_url":"https://api.github.com/repos/ygrek/ocaml-extlib/issues/3/events","html_url":"https://github.com/ygrek/ocaml-extlib/pull/3","id":91034381,"number":3,"title":"Give users the possibility to set the exit code in optParse","user":{"login":"abate","id":106752,"avatar_url":"https://avatars.githubusercontent.com/u/106752?v=3","gravatar_id":"","url":"https://api.github.com/users/abate","html_url":"https://github.com/abate","followers_url":"https://api.github.com/users/abate/followers","following_url":"https://api.github.com/users/abate/following{/other_user}","gists_url":"https://api.github.com/users/abate/gists{/gist_id}","starred_url":"https://api.github.com/users/abate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abate/subscriptions","organizations_url":"https://api.github.com/users/abate/orgs","repos_url":"https://api.github.com/users/abate/repos","events_url":"https://api.github.com/users/abate/events{/privacy}","received_events_url":"https://api.github.com/users/abate/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"ygrek","id":104087,"avatar_url":"https://avatars.githubusercontent.com/u/104087?v=3","gravatar_id":"","url":"https://api.github.com/users/ygrek","html_url":"https://github.com/ygrek","followers_url":"https://api.github.com/users/ygrek/followers","following_url":"https://api.github.com/users/ygrek/following{/other_user}","gists_url":"https://api.github.com/users/ygrek/gists{/gist_id}","starred_url":"https://api.github.com/users/ygrek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ygrek/subscriptions","organizations_url":"https://api.github.com/users/ygrek/orgs","repos_url":"https://api.github.com/users/ygrek/repos","events_url":"https://api.github.com/users/ygrek/events{/privacy}","received_events_url":"https://api.github.com/users/ygrek/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-06-25T18:01:42Z","updated_at":"2015-06-28T07:34:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ygrek/ocaml-extlib/pulls/3","html_url":"https://github.com/ygrek/ocaml-extlib/pull/3","diff_url":"https://github.com/ygrek/ocaml-extlib/pull/3.diff","patch_url":"https://github.com/ygrek/ocaml-extlib/pull/3.patch"},"body":"This patch breaks the current API. Add a new optional parameter to OptParse.OptParser.make and remove an optional parameter from OptParse.OptParser.error.\r\n\r\nMy use case : my application (dose-distcheck) uses exist codes in a more liberal way : Exit codes 0-63 indicate a normal termination of the program, codes 64-127 indicate abnormal termination of the program. As it stands it is impossible to catch the exit status due to an parse error in the options. This patch adds this possibility. Another way would be not to exit directly, but to raise an exception and let the user to deal with the parsing error. "},"comment":{"url":"https://api.github.com/repos/ygrek/ocaml-extlib/issues/comments/116209590","html_url":"https://github.com/ygrek/ocaml-extlib/pull/3#issuecomment-116209590","issue_url":"https://api.github.com/repos/ygrek/ocaml-extlib/issues/3","id":116209590,"user":{"login":"abate","id":106752,"avatar_url":"https://avatars.githubusercontent.com/u/106752?v=3","gravatar_id":"","url":"https://api.github.com/users/abate","html_url":"https://github.com/abate","followers_url":"https://api.github.com/users/abate/followers","following_url":"https://api.github.com/users/abate/following{/other_user}","gists_url":"https://api.github.com/users/abate/gists{/gist_id}","starred_url":"https://api.github.com/users/abate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abate/subscriptions","organizations_url":"https://api.github.com/users/abate/orgs","repos_url":"https://api.github.com/users/abate/repos","events_url":"https://api.github.com/users/abate/events{/privacy}","received_events_url":"https://api.github.com/users/abate/received_events","type":"User","site_admin":false},"created_at":"2015-06-28T07:34:17Z","updated_at":"2015-06-28T07:34:17Z","body":"You mean keep ```?(status=1)``` in the function ```error```, but not use it ? Ideally, your would like to keep the optional parameter and use it instead of the default value in ```optparser.op_status``` if the user passes this optional parameter while calling the function. But since the parameter status has a default value, we cannot distinguish if it was passed by the user or not... We could do the other way around, using None as a default for ```optparser.op_status``` and if this is not set, use the value of ```status``` instead, but I would not expect this behavior from this function. Therefore, either we remove status, or we remove its default. Either ways, the function signature is different. In my opinion removing status altogether is not such that bad thing ... I hope I was clear."}}