{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/cargo/issues/1720","labels_url":"https://api.github.com/repos/rust-lang/cargo/issues/1720/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/cargo/issues/1720/comments","events_url":"https://api.github.com/repos/rust-lang/cargo/issues/1720/events","html_url":"https://github.com/rust-lang/cargo/issues/1720","id":88696815,"number":1720,"title":"Inconsistent handling of command-line key/value arguments separated by `=`","user":{"login":"mlalic","id":229614,"avatar_url":"https://avatars.githubusercontent.com/u/229614?v=3","gravatar_id":"","url":"https://api.github.com/users/mlalic","html_url":"https://github.com/mlalic","followers_url":"https://api.github.com/users/mlalic/followers","following_url":"https://api.github.com/users/mlalic/following{/other_user}","gists_url":"https://api.github.com/users/mlalic/gists{/gist_id}","starred_url":"https://api.github.com/users/mlalic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlalic/subscriptions","organizations_url":"https://api.github.com/users/mlalic/orgs","repos_url":"https://api.github.com/users/mlalic/repos","events_url":"https://api.github.com/users/mlalic/events{/privacy}","received_events_url":"https://api.github.com/users/mlalic/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-16T11:20:02Z","updated_at":"2015-06-18T07:58:45Z","closed_at":"2015-06-17T23:09:44Z","body":"Imagine a crate with two optional features, named \"first\" and \"second\".\r\n\r\nThis is how cargo handles different command line arguments:\r\n\r\n- `cargo build --features=\"first\"` - compiles the \"first\" feature, as expected\r\n- `cargo build --features \"first\"` - compiles the \"first\" feature, as expected\r\n- `cargo build --features \"first second\"` - compiles both features, as expected\r\n- `cargo build --features=\"first second\"` - returns *invalid arguments*\r\n- `cargo test --features \"first second\"` - compiles and correctly runs the tests\r\n- `cargo test --features=\"first second\"` - compiles the source ignoring both features and then passes the `--features=\"first second\"` bit to the executable, which causes it to panic since it's not a recognized option\r\n\r\nTo summarize, when the value is a space separated (but still quoted) string and the key/value argument is specified as a single command-line argument (where the key and value are separated by a `=`), the build command says that the arguments are invalid, while the test completely fizzles out. When the value is a single string (with no spaces), then both styles work identically.\r\n\r\nIn my opinion, cargo should properly handle `=` separated option-value arguments, which means that the result should be the same as when the value is a separate command-line argument in all cases.\r\n\r\nIf, however, this style is not to be supported by cargo, then it should at least always cause the invalid arguments message when used, otherwise it leads to inconsistencies such as the `build` command failing, but `test` working (and failing very unexpectedly), while given the same set of command line arguments.\r\n"},"comment":{"url":"https://api.github.com/repos/rust-lang/cargo/issues/comments/113067614","html_url":"https://github.com/rust-lang/cargo/issues/1720#issuecomment-113067614","issue_url":"https://api.github.com/repos/rust-lang/cargo/issues/1720","id":113067614,"user":{"login":"mlalic","id":229614,"avatar_url":"https://avatars.githubusercontent.com/u/229614?v=3","gravatar_id":"","url":"https://api.github.com/users/mlalic","html_url":"https://github.com/mlalic","followers_url":"https://api.github.com/users/mlalic/followers","following_url":"https://api.github.com/users/mlalic/following{/other_user}","gists_url":"https://api.github.com/users/mlalic/gists{/gist_id}","starred_url":"https://api.github.com/users/mlalic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlalic/subscriptions","organizations_url":"https://api.github.com/users/mlalic/orgs","repos_url":"https://api.github.com/users/mlalic/repos","events_url":"https://api.github.com/users/mlalic/events{/privacy}","received_events_url":"https://api.github.com/users/mlalic/received_events","type":"User","site_admin":false},"created_at":"2015-06-18T07:58:45Z","updated_at":"2015-06-18T07:58:45Z","body":"@BurntSushi Thanks for the quick fix and the extra context there!"}}