{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang-nursery/cli-wg/issues/12","repository_url":"https://api.github.com/repos/rust-lang-nursery/cli-wg","labels_url":"https://api.github.com/repos/rust-lang-nursery/cli-wg/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang-nursery/cli-wg/issues/12/comments","events_url":"https://api.github.com/repos/rust-lang-nursery/cli-wg/issues/12/events","html_url":"https://github.com/rust-lang-nursery/cli-wg/issues/12","id":298719701,"number":12,"title":"Error handling in CLI apps","user":{"login":"killercup","id":20063,"avatar_url":"https://avatars1.githubusercontent.com/u/20063?v=4","gravatar_id":"","url":"https://api.github.com/users/killercup","html_url":"https://github.com/killercup","followers_url":"https://api.github.com/users/killercup/followers","following_url":"https://api.github.com/users/killercup/following{/other_user}","gists_url":"https://api.github.com/users/killercup/gists{/gist_id}","starred_url":"https://api.github.com/users/killercup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/killercup/subscriptions","organizations_url":"https://api.github.com/users/killercup/orgs","repos_url":"https://api.github.com/users/killercup/repos","events_url":"https://api.github.com/users/killercup/events{/privacy}","received_events_url":"https://api.github.com/users/killercup/received_events","type":"User","site_admin":false},"labels":[{"id":843054662,"url":"https://api.github.com/repos/rust-lang-nursery/cli-wg/labels/tracking%20issue","name":"tracking issue","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2018-02-20T19:31:39Z","updated_at":"2018-03-21T15:55:52Z","closed_at":null,"author_association":"COLLABORATOR","body":"In the first meeting, we've [discussed](https://github.com/rust-lang-nursery/cli-wg/blob/07bf43d0a58843439eef14db90988fee1df1ec7d/logs/2018-02-20-cli-wg-initial-meeting.log#L40) that we should have a best practice for error handling in CLI apps."},"comment":{"url":"https://api.github.com/repos/rust-lang-nursery/cli-wg/issues/comments/374990407","html_url":"https://github.com/rust-lang-nursery/cli-wg/issues/12#issuecomment-374990407","issue_url":"https://api.github.com/repos/rust-lang-nursery/cli-wg/issues/12","id":374990407,"user":{"login":"uazu","id":2729716,"avatar_url":"https://avatars1.githubusercontent.com/u/2729716?v=4","gravatar_id":"","url":"https://api.github.com/users/uazu","html_url":"https://github.com/uazu","followers_url":"https://api.github.com/users/uazu/followers","following_url":"https://api.github.com/users/uazu/following{/other_user}","gists_url":"https://api.github.com/users/uazu/gists{/gist_id}","starred_url":"https://api.github.com/users/uazu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uazu/subscriptions","organizations_url":"https://api.github.com/users/uazu/orgs","repos_url":"https://api.github.com/users/uazu/repos","events_url":"https://api.github.com/users/uazu/events{/privacy}","received_events_url":"https://api.github.com/users/uazu/received_events","type":"User","site_admin":false},"created_at":"2018-03-21T15:55:52Z","updated_at":"2018-03-21T15:55:52Z","author_association":"NONE","body":"To me a CLI app is not intended to be long-lived. It is supposed to do its job and then exit. So just outputting an error message to stderr and returning a non-zero exit status is enough for very many apps. Mostly you can count on the OS to do cleanup. However, for bigger and more complicated apps that perhaps require more complicated cleanup, then yes it makes sense to propagate errors up to main.\r\n\r\nNote that there are some valid reasons for using exit statuses apart from 0 and 1. An example might be differentiating soft and hard failures, which can be useful to recognise easily from a script, i.e. to check $? instead of parsing output."}}
{"actor":{"display_login":"uazu"}}