{"action":"closed","issue":{"url":"https://api.github.com/repos/yeoman/generator/issues/813","labels_url":"https://api.github.com/repos/yeoman/generator/issues/813/labels{/name}","comments_url":"https://api.github.com/repos/yeoman/generator/issues/813/comments","events_url":"https://api.github.com/repos/yeoman/generator/issues/813/events","html_url":"https://github.com/yeoman/generator/issues/813","id":83031123,"number":813,"title":"this.option -> type doesn't coerce","user":{"login":"olsonpm","id":5957709,"avatar_url":"https://avatars.githubusercontent.com/u/5957709?v=3","gravatar_id":"","url":"https://api.github.com/users/olsonpm","html_url":"https://github.com/olsonpm","followers_url":"https://api.github.com/users/olsonpm/followers","following_url":"https://api.github.com/users/olsonpm/following{/other_user}","gists_url":"https://api.github.com/users/olsonpm/gists{/gist_id}","starred_url":"https://api.github.com/users/olsonpm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olsonpm/subscriptions","organizations_url":"https://api.github.com/users/olsonpm/orgs","repos_url":"https://api.github.com/users/olsonpm/repos","events_url":"https://api.github.com/users/olsonpm/events{/privacy}","received_events_url":"https://api.github.com/users/olsonpm/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-31T07:48:05Z","updated_at":"2015-06-01T01:37:59Z","closed_at":"2015-06-01T01:37:59Z","body":"So I would expect that by setting an option to a type, that any values passed via that option would at least get coerced.  Instead what happens is the type turns into whatever the passed in value seems to be (didn't look at the code for how a type is figured).\r\n\r\nFor example\r\n```\r\ngit clone https://github.com/olsonpm/generator-option-type\r\ncd generator-option-type\r\nnpm install\r\nnpm link\r\n\r\n# now make a temporary directory - assume the below doesn't exist\r\nmkdir -p ~/tmp.d/yeoman\r\ncd ~/tmp.d/yeoman\r\n\r\n# typeof aBoolOpt is undefined - makes sense since we never passed it\r\nyo option-type\r\n> typeof aBoolOpt: undefined\r\n\r\n# typeof aBoolOpt is a boolean - also expected\r\nyo option-type --aBoolOpt\r\n> typeof aBoolOpt: boolean\r\n\r\n# typeof aBoolOpt is a string, then a number\r\nyo option-type --aBoolOpt=false\r\n> typeof aBoolOpt: string\r\n\r\nyo option-type --aBoolOpt=0\r\n> typeof aBoolOpt: number\r\n```\r\n\r\nIf this is the behavior, then what exactly is the point of declaring an option type?"}}