{"action":"closed","issue":{"url":"https://api.github.com/repos/jatoben/CommandLine/issues/24","labels_url":"https://api.github.com/repos/jatoben/CommandLine/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/jatoben/CommandLine/issues/24/comments","events_url":"https://api.github.com/repos/jatoben/CommandLine/issues/24/events","html_url":"https://github.com/jatoben/CommandLine/issues/24","id":92523895,"number":24,"title":"BoolOption.isSet true by default","user":{"login":"beltex","id":2666961,"avatar_url":"https://avatars.githubusercontent.com/u/2666961?v=3","gravatar_id":"","url":"https://api.github.com/users/beltex","html_url":"https://github.com/beltex","followers_url":"https://api.github.com/users/beltex/followers","following_url":"https://api.github.com/users/beltex/following{/other_user}","gists_url":"https://api.github.com/users/beltex/gists{/gist_id}","starred_url":"https://api.github.com/users/beltex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beltex/subscriptions","organizations_url":"https://api.github.com/users/beltex/orgs","repos_url":"https://api.github.com/users/beltex/repos","events_url":"https://api.github.com/users/beltex/events{/privacy}","received_events_url":"https://api.github.com/users/beltex/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jatoben/CommandLine/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-02T01:39:46Z","updated_at":"2015-07-03T04:26:19Z","closed_at":"2015-07-03T04:26:19Z","body":"I was wondering, shouldn’t `BoolOption.isSet` **_not_** be true by default for consistency with other options? The reason I ask is that it thwarts common patterns for trying to determine which options are set after parsing.\r\n\r\n```swift\r\nvar CLIOptions = [Option]()\r\n\r\n// Create options, parse, etc., ...\r\n\r\n// This doesn’t currently work because of BoolOption (since its true by default)\r\nlet flagsOn = CLIOptions.filter { $0.isSet }\r\n\r\n// A work around\r\nlet isSetNonBoolOptions = CLIOptions.filter { $0.isSet == true &&\r\n                                              $0 as? BoolOption == nil }\r\nlet isSetBoolOptions = CLIOptions.filter { $0 as? BoolOption != nil }\r\n                                 .map    { $0 as! BoolOption        }\r\n                                 .filter { $0.value == true         }\r\n```\r\n\r\nIs there a better way to go about this? Love to hear what you think!"}}