{"action":"created","comment":{"url":"https://api.github.com/repos/markhibberd/pirate/pulls/comments/24157825","id":24157825,"diff_hunk":"@@ -176,17 +194,45 @@ object ParseTraversal {\n         })\n     }\n \n-  def eval[A](p: Parse[A]): Option[A] = p match {\n+  def parseError[A](arg: String): P[A] =\n+    arg.toList match {\n+      case '-' :: _ => errorMessageP(s\"Invalid option `${arg}`\")\n+      case _        => errorMessageP(s\"Invalid argument `${arg}`\")\n+    }\n+\n+  def eval[A](p: Parse[A]): ValidationNel[MissingParser, A] = p match {\n     case ValueParse(o) =>\n-      o\n+      o.successNel\n     case ParserParse(p) =>\n-      None\n+      p match {\n+        case SwitchParser(meta, _) =>\n+          MissingFlag(meta.names.get.render).failureNel\n+        case FlagParser(meta, _) =>\n+          MissingFlag(meta.names.get.render).failureNel\n+        case ArgumentParser(meta, p) =>\n+          MissingArg(meta.metavar).failureNel\n+        case CommandParser(sub) =>\n+          MissingCommand(sub.name).failureNel","path":"src/main/scala/pirate.internal/ParseTraversal.scala","position":112,"original_position":112,"commit_id":"e2ac01525ffa44880ed282e51c53cba0a636a955","original_commit_id":"e2ac01525ffa44880ed282e51c53cba0a636a955","user":{"login":"FrontierOtr","id":5205457,"avatar_url":"https://avatars.githubusercontent.com/u/5205457?v=3","gravatar_id":"","url":"https://api.github.com/users/FrontierOtr","html_url":"https://github.com/FrontierOtr","followers_url":"https://api.github.com/users/FrontierOtr/followers","following_url":"https://api.github.com/users/FrontierOtr/following{/other_user}","gists_url":"https://api.github.com/users/FrontierOtr/gists{/gist_id}","starred_url":"https://api.github.com/users/FrontierOtr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FrontierOtr/subscriptions","organizations_url":"https://api.github.com/users/FrontierOtr/orgs","repos_url":"https://api.github.com/users/FrontierOtr/repos","events_url":"https://api.github.com/users/FrontierOtr/events{/privacy}","received_events_url":"https://api.github.com/users/FrontierOtr/received_events","type":"User","site_admin":false},"body":"Hmm... yes.","created_at":"2015-02-05T11:37:17Z","updated_at":"2015-02-05T11:37:17Z","html_url":"https://github.com/markhibberd/pirate/pull/32#discussion_r24157825","pull_request_url":"https://api.github.com/repos/markhibberd/pirate/pulls/32","_links":{"self":{"href":"https://api.github.com/repos/markhibberd/pirate/pulls/comments/24157825"},"html":{"href":"https://github.com/markhibberd/pirate/pull/32#discussion_r24157825"},"pull_request":{"href":"https://api.github.com/repos/markhibberd/pirate/pulls/32"}}},"pull_request":{"url":"https://api.github.com/repos/markhibberd/pirate/pulls/32","id":28711225,"html_url":"https://github.com/markhibberd/pirate/pull/32","diff_url":"https://github.com/markhibberd/pirate/pull/32.diff","patch_url":"https://github.com/markhibberd/pirate/pull/32.patch","issue_url":"https://api.github.com/repos/markhibberd/pirate/issues/32","number":32,"state":"open","locked":false,"title":"Add Usage errors for bad parsing, missing reqs and bad flags","user":{"login":"FrontierOtr","id":5205457,"avatar_url":"https://avatars.githubusercontent.com/u/5205457?v=3","gravatar_id":"","url":"https://api.github.com/users/FrontierOtr","html_url":"https://github.com/FrontierOtr","followers_url":"https://api.github.com/users/FrontierOtr/followers","following_url":"https://api.github.com/users/FrontierOtr/following{/other_user}","gists_url":"https://api.github.com/users/FrontierOtr/gists{/gist_id}","starred_url":"https://api.github.com/users/FrontierOtr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FrontierOtr/subscriptions","organizations_url":"https://api.github.com/users/FrontierOtr/orgs","repos_url":"https://api.github.com/users/FrontierOtr/repos","events_url":"https://api.github.com/users/FrontierOtr/events{/privacy}","received_events_url":"https://api.github.com/users/FrontierOtr/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-05T09:53:24Z","updated_at":"2015-02-05T11:37:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bb8c964d47da907ef1a4908609caa992f22fba11","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/markhibberd/pirate/pulls/32/commits","review_comments_url":"https://api.github.com/repos/markhibberd/pirate/pulls/32/comments","review_comment_url":"https://api.github.com/repos/markhibberd/pirate/pulls/comments/{number}","comments_url":"https://api.github.com/repos/markhibberd/pirate/issues/32/comments","statuses_url":"https://api.github.com/repos/markhibberd/pirate/statuses/e2ac01525ffa44880ed282e51c53cba0a636a955","head":{"label":"markhibberd:topic/missinginvalid","ref":"topic/missinginvalid","sha":"e2ac01525ffa44880ed282e51c53cba0a636a955","user":{"login":"markhibberd","id":22832,"avatar_url":"https://avatars.githubusercontent.com/u/22832?v=3","gravatar_id":"","url":"https://api.github.com/users/markhibberd","html_url":"https://github.com/markhibberd","followers_url":"https://api.github.com/users/markhibberd/followers","following_url":"https://api.github.com/users/markhibberd/following{/other_user}","gists_url":"https://api.github.com/users/markhibberd/gists{/gist_id}","starred_url":"https://api.github.com/users/markhibberd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markhibberd/subscriptions","organizations_url":"https://api.github.com/users/markhibberd/orgs","repos_url":"https://api.github.com/users/markhibberd/repos","events_url":"https://api.github.com/users/markhibberd/events{/privacy}","received_events_url":"https://api.github.com/users/markhibberd/received_events","type":"User","site_admin":false},"repo":{"id":1102396,"name":"pirate","full_name":"markhibberd/pirate","owner":{"login":"markhibberd","id":22832,"avatar_url":"https://avatars.githubusercontent.com/u/22832?v=3","gravatar_id":"","url":"https://api.github.com/users/markhibberd","html_url":"https://github.com/markhibberd","followers_url":"https://api.github.com/users/markhibberd/followers","following_url":"https://api.github.com/users/markhibberd/following{/other_user}","gists_url":"https://api.github.com/users/markhibberd/gists{/gist_id}","starred_url":"https://api.github.com/users/markhibberd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markhibberd/subscriptions","organizations_url":"https://api.github.com/users/markhibberd/orgs","repos_url":"https://api.github.com/users/markhibberd/repos","events_url":"https://api.github.com/users/markhibberd/events{/privacy}","received_events_url":"https://api.github.com/users/markhibberd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/markhibberd/pirate","description":"Non-horrible command line parsing.","fork":false,"url":"https://api.github.com/repos/markhibberd/pirate","forks_url":"https://api.github.com/repos/markhibberd/pirate/forks","keys_url":"https://api.github.com/repos/markhibberd/pirate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/markhibberd/pirate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/markhibberd/pirate/teams","hooks_url":"https://api.github.com/repos/markhibberd/pirate/hooks","issue_events_url":"https://api.github.com/repos/markhibberd/pirate/issues/events{/number}","events_url":"https://api.github.com/repos/markhibberd/pirate/events","assignees_url":"https://api.github.com/repos/markhibberd/pirate/assignees{/user}","branches_url":"https://api.github.com/repos/markhibberd/pirate/branches{/branch}","tags_url":"https://api.github.com/repos/markhibberd/pirate/tags","blobs_url":"https://api.github.com/repos/markhibberd/pirate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/markhibberd/pirate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/markhibberd/pirate/git/refs{/sha}","trees_url":"https://api.github.com/repos/markhibberd/pirate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/markhibberd/pirate/statuses/{sha}","languages_url":"https://api.github.com/repos/markhibberd/pirate/languages","stargazers_url":"https://api.github.com/repos/markhibberd/pirate/stargazers","contributors_url":"https://api.github.com/repos/markhibberd/pirate/contributors","subscribers_url":"https://api.github.com/repos/markhibberd/pirate/subscribers","subscription_url":"https://api.github.com/repos/markhibberd/pirate/subscription","commits_url":"https://api.github.com/repos/markhibberd/pirate/commits{/sha}","git_commits_url":"https://api.github.com/repos/markhibberd/pirate/git/commits{/sha}","comments_url":"https://api.github.com/repos/markhibberd/pirate/comments{/number}","issue_comment_url":"https://api.github.com/repos/markhibberd/pirate/issues/comments/{number}","contents_url":"https://api.github.com/repos/markhibberd/pirate/contents/{+path}","compare_url":"https://api.github.com/repos/markhibberd/pirate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/markhibberd/pirate/merges","archive_url":"https://api.github.com/repos/markhibberd/pirate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/markhibberd/pirate/downloads","issues_url":"https://api.github.com/repos/markhibberd/pirate/issues{/number}","pulls_url":"https://api.github.com/repos/markhibberd/pirate/pulls{/number}","milestones_url":"https://api.github.com/repos/markhibberd/pirate/milestones{/number}","notifications_url":"https://api.github.com/repos/markhibberd/pirate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/markhibberd/pirate/labels{/name}","releases_url":"https://api.github.com/repos/markhibberd/pirate/releases{/id}","created_at":"2010-11-22T13:49:35Z","updated_at":"2015-02-04T21:41:16Z","pushed_at":"2015-02-05T09:49:01Z","git_url":"git://github.com/markhibberd/pirate.git","ssh_url":"git@github.com:markhibberd/pirate.git","clone_url":"https://github.com/markhibberd/pirate.git","svn_url":"https://github.com/markhibberd/pirate","homepage":"https://github.com/markhibberd/pirate","size":41888,"stargazers_count":12,"watchers_count":12,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":7,"forks":4,"open_issues":7,"watchers":12,"default_branch":"master"}},"base":{"label":"markhibberd:master","ref":"master","sha":"7fb0ddeeabcc10c56301083dc090a7be0bbbb595","user":{"login":"markhibberd","id":22832,"avatar_url":"https://avatars.githubusercontent.com/u/22832?v=3","gravatar_id":"","url":"https://api.github.com/users/markhibberd","html_url":"https://github.com/markhibberd","followers_url":"https://api.github.com/users/markhibberd/followers","following_url":"https://api.github.com/users/markhibberd/following{/other_user}","gists_url":"https://api.github.com/users/markhibberd/gists{/gist_id}","starred_url":"https://api.github.com/users/markhibberd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markhibberd/subscriptions","organizations_url":"https://api.github.com/users/markhibberd/orgs","repos_url":"https://api.github.com/users/markhibberd/repos","events_url":"https://api.github.com/users/markhibberd/events{/privacy}","received_events_url":"https://api.github.com/users/markhibberd/received_events","type":"User","site_admin":false},"repo":{"id":1102396,"name":"pirate","full_name":"markhibberd/pirate","owner":{"login":"markhibberd","id":22832,"avatar_url":"https://avatars.githubusercontent.com/u/22832?v=3","gravatar_id":"","url":"https://api.github.com/users/markhibberd","html_url":"https://github.com/markhibberd","followers_url":"https://api.github.com/users/markhibberd/followers","following_url":"https://api.github.com/users/markhibberd/following{/other_user}","gists_url":"https://api.github.com/users/markhibberd/gists{/gist_id}","starred_url":"https://api.github.com/users/markhibberd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markhibberd/subscriptions","organizations_url":"https://api.github.com/users/markhibberd/orgs","repos_url":"https://api.github.com/users/markhibberd/repos","events_url":"https://api.github.com/users/markhibberd/events{/privacy}","received_events_url":"https://api.github.com/users/markhibberd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/markhibberd/pirate","description":"Non-horrible command line parsing.","fork":false,"url":"https://api.github.com/repos/markhibberd/pirate","forks_url":"https://api.github.com/repos/markhibberd/pirate/forks","keys_url":"https://api.github.com/repos/markhibberd/pirate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/markhibberd/pirate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/markhibberd/pirate/teams","hooks_url":"https://api.github.com/repos/markhibberd/pirate/hooks","issue_events_url":"https://api.github.com/repos/markhibberd/pirate/issues/events{/number}","events_url":"https://api.github.com/repos/markhibberd/pirate/events","assignees_url":"https://api.github.com/repos/markhibberd/pirate/assignees{/user}","branches_url":"https://api.github.com/repos/markhibberd/pirate/branches{/branch}","tags_url":"https://api.github.com/repos/markhibberd/pirate/tags","blobs_url":"https://api.github.com/repos/markhibberd/pirate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/markhibberd/pirate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/markhibberd/pirate/git/refs{/sha}","trees_url":"https://api.github.com/repos/markhibberd/pirate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/markhibberd/pirate/statuses/{sha}","languages_url":"https://api.github.com/repos/markhibberd/pirate/languages","stargazers_url":"https://api.github.com/repos/markhibberd/pirate/stargazers","contributors_url":"https://api.github.com/repos/markhibberd/pirate/contributors","subscribers_url":"https://api.github.com/repos/markhibberd/pirate/subscribers","subscription_url":"https://api.github.com/repos/markhibberd/pirate/subscription","commits_url":"https://api.github.com/repos/markhibberd/pirate/commits{/sha}","git_commits_url":"https://api.github.com/repos/markhibberd/pirate/git/commits{/sha}","comments_url":"https://api.github.com/repos/markhibberd/pirate/comments{/number}","issue_comment_url":"https://api.github.com/repos/markhibberd/pirate/issues/comments/{number}","contents_url":"https://api.github.com/repos/markhibberd/pirate/contents/{+path}","compare_url":"https://api.github.com/repos/markhibberd/pirate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/markhibberd/pirate/merges","archive_url":"https://api.github.com/repos/markhibberd/pirate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/markhibberd/pirate/downloads","issues_url":"https://api.github.com/repos/markhibberd/pirate/issues{/number}","pulls_url":"https://api.github.com/repos/markhibberd/pirate/pulls{/number}","milestones_url":"https://api.github.com/repos/markhibberd/pirate/milestones{/number}","notifications_url":"https://api.github.com/repos/markhibberd/pirate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/markhibberd/pirate/labels{/name}","releases_url":"https://api.github.com/repos/markhibberd/pirate/releases{/id}","created_at":"2010-11-22T13:49:35Z","updated_at":"2015-02-04T21:41:16Z","pushed_at":"2015-02-05T09:49:01Z","git_url":"git://github.com/markhibberd/pirate.git","ssh_url":"git@github.com:markhibberd/pirate.git","clone_url":"https://github.com/markhibberd/pirate.git","svn_url":"https://github.com/markhibberd/pirate","homepage":"https://github.com/markhibberd/pirate","size":41888,"stargazers_count":12,"watchers_count":12,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":7,"forks":4,"open_issues":7,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/markhibberd/pirate/pulls/32"},"html":{"href":"https://github.com/markhibberd/pirate/pull/32"},"issue":{"href":"https://api.github.com/repos/markhibberd/pirate/issues/32"},"comments":{"href":"https://api.github.com/repos/markhibberd/pirate/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/markhibberd/pirate/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/markhibberd/pirate/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/markhibberd/pirate/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/markhibberd/pirate/statuses/e2ac01525ffa44880ed282e51c53cba0a636a955"}}}}