{"action":"created","issue":{"url":"https://api.github.com/repos/kbknapp/clap-rs/issues/735","repository_url":"https://api.github.com/repos/kbknapp/clap-rs","labels_url":"https://api.github.com/repos/kbknapp/clap-rs/issues/735/labels{/name}","comments_url":"https://api.github.com/repos/kbknapp/clap-rs/issues/735/comments","events_url":"https://api.github.com/repos/kbknapp/clap-rs/issues/735/events","html_url":"https://github.com/kbknapp/clap-rs/issues/735","id":187898684,"number":735,"title":"End of options marker: `--`","user":{"login":"jdub","id":276281,"avatar_url":"https://avatars.githubusercontent.com/u/276281?v=3","gravatar_id":"","url":"https://api.github.com/users/jdub","html_url":"https://github.com/jdub","followers_url":"https://api.github.com/users/jdub/followers","following_url":"https://api.github.com/users/jdub/following{/other_user}","gists_url":"https://api.github.com/users/jdub/gists{/gist_id}","starred_url":"https://api.github.com/users/jdub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdub/subscriptions","organizations_url":"https://api.github.com/users/jdub/orgs","repos_url":"https://api.github.com/users/jdub/repos","events_url":"https://api.github.com/users/jdub/events{/privacy}","received_events_url":"https://api.github.com/users/jdub/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-08T04:22:13Z","updated_at":"2016-11-08T20:25:09Z","closed_at":null,"body":"I can't seem to find anything in the documentation or other issues about the end of options terminator, `--`.\r\n\r\nI'm rejigging Servo's `bindgen` command line parsing with `clap`, and it relies on passing all arguments after `--` directly to Clang, for example:\r\n\r\n```\r\nbindgen example.h --use-core --raw-line \"#![no_std]\" -- -std=c++11\r\n```\r\n\r\nFor now, it's easy enough to strip `--` and everything after it out before passing the arguments to `clap`, but it'd be rad to support this directly."},"comment":{"url":"https://api.github.com/repos/kbknapp/clap-rs/issues/comments/259249272","html_url":"https://github.com/kbknapp/clap-rs/issues/735#issuecomment-259249272","issue_url":"https://api.github.com/repos/kbknapp/clap-rs/issues/735","id":259249272,"user":{"login":"kbknapp","id":6942134,"avatar_url":"https://avatars.githubusercontent.com/u/6942134?v=3","gravatar_id":"","url":"https://api.github.com/users/kbknapp","html_url":"https://github.com/kbknapp","followers_url":"https://api.github.com/users/kbknapp/followers","following_url":"https://api.github.com/users/kbknapp/following{/other_user}","gists_url":"https://api.github.com/users/kbknapp/gists{/gist_id}","starred_url":"https://api.github.com/users/kbknapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbknapp/subscriptions","organizations_url":"https://api.github.com/users/kbknapp/orgs","repos_url":"https://api.github.com/users/kbknapp/repos","events_url":"https://api.github.com/users/kbknapp/events{/privacy}","received_events_url":"https://api.github.com/users/kbknapp/received_events","type":"User","site_admin":false},"created_at":"2016-11-08T20:25:09Z","updated_at":"2016-11-08T20:25:09Z","body":"`clap` supports this directly. The way it works is it'll store everything after `--` in a positional arg. The only caveat is this positional arg needs have `multiple(true)` set.\r\n\r\ni.e.\r\n\r\n```rust\r\nApp::new(\"test\")\r\n    .arg(Arg::with_name(\"vals\")\r\n        .multiple(true))\r\n```\r\n\r\nThen running `$ test -- one two three four` will result in `vals` being `[\"one\", \"two\", \"three\", \"four\"]`."}}
{"actor":{"display_login":"kbknapp"}}