[rust-dev] Is it just me, or do the API docs lie about getopt() in rust v0.8?

Corey Richardson corey at octayn.net
Mon Jan 13 16:50:17 PST 2014


You're looking at the wrong getopts function. You're looking at
extra::getopts::getopts, but citing the documentation for
extra::getopts::groups::getopts.

On Mon, Jan 13, 2014 at 7:48 PM, Andrew Pennebaker
<andrew.pennebaker at gmail.com> wrote:
> I'm following tutorials and snippets to get my code to work with rust 0.8
> (I'm behind, I know).
>
> The rust docs for v0.8 say that getopt() accepts an array of OptGroup (long
> options), and my code is written to use that.
>
> http://static.rust-lang.org/doc/0.8/extra/getopts/groups/fn.getopts.html
>
> But when I dig through the rust source code around version 0.8, this is not
> the API that I find.
>
> https://github.com/mozilla/rust/blob/7c92435f8f93344330e47fb0cca4f79297896bd2/src/libextra/getopts.rs#L396
>
> Am I doing something wrong?
>
> What's the easiest way to convert an array of long options into an array of
> short options for the purposes of using getopt()?
>
> Is this discrepancy fixed in 0.9?
>
> --
> Cheers,
>
> Andrew Pennebaker
> www.yellosoft.us
>
> _______________________________________________
> Rust-dev mailing list
> Rust-dev at mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev
>


More information about the Rust-dev mailing list