Comments (4)
In the reference implementation, all these tests pass. So you are welcome to make a pull request to include these tests in the language-agnostic test-suite.
from docopt.rs.
I believe we've just run into this in cargo as well: rust-lang/cargo#492.
It looks like the reference implementation does indeed parse --
as trailing arguments all passed to <arg>
, but not the rust implementation:
#![feature(phase)]
#[phase(plugin, link)] extern crate docopt_macros;
extern crate docopt;
extern crate serialize;
use docopt::FlagParser;
docopt!(Args,"
Usage:
foo test [--] [<args>...]
")
fn main() {
let args: Args = FlagParser::parse().unwrap_or_else(|e| e.exit());
println!("{}", args);
}
$ ./foo test -- --foo
Unknown flag: '--foo'
Usage:
foo test [--] [<args>...]
from docopt.rs.
@alexcrichton Hopefully all fixed now. :-)
from docopt.rs.
Awesome, thanks @BurntSushi!
from docopt.rs.
Related Issues (20)
- confusing failure mode when usage and option sections are inconsistent HOT 2
- Panic on duplicates in the options section
- argument name with `_` underscore is misaligned to `-` hyphen HOT 1
- Could not compile by docopt_macros error at macro.rs line 187 HOT 1
- Silent breaking change in docopt 0.8.2 HOT 1
- Linking error during compilation HOT 1
- Strange behavior if subcommand starts with program name
- When repeated short and long =value flags are aliases, only one is deserialised HOT 2
- trouble with argument lists split over multiple lines HOT 1
- Allow Overlapping Option and Usage Flags for Documentation
- 1.1.0 Does not compile HOT 5
- Would `docopt_macros` still require nightly? HOT 1
- -h in priority
- Optional argument parsed as None instead of Some(_) if using '_' in option name
- Huge amount of memory used and very slow when parsing many arguments HOT 2
- get_vec and the borrow checker play badly together HOT 1
- Hidden undocumented options? HOT 1
- Positional arguments are misparsed as --required arguments HOT 4
- [Issue] Optional arguments in final array HOT 1
- Does docopt-style API scale to the complex use-cases? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docopt.rs.