# Struct getopts::Options [−] [src]

    pub struct Options { /* fields omitted */ }

🔬 This is a nightly-only experimental API. (`rustc_private`)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?

A description of the options that a program can handle.

## Methods

### `impl Options`
[src]

#### `pub fn new() -> Options`
[src]

🔬 This is a nightly-only experimental API. (`rustc_private`)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?

Create a blank set of options.

#### `pub fn parsing_style(&mut self, style: ParsingStyle) -> &mut Options`
[src]

🔬 This is a nightly-only experimental API. (`rustc_private`)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?

Set the parsing style.

#### `pub fn long_only(&mut self, long_only: bool) -> &mut Options`
[src]

🔬 This is a nightly-only experimental API. (`rustc_private`)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?

Set or clear "long options only" mode.

In "long options only" mode, short options cannot be clustered together, and long options can be given with either a single "-" or the customary "--". This mode also changes the meaning of "-a=b"; in the ordinary mode this will parse a short option "-a" with argument "=b"; whereas in long-options-only mode the argument will be simply "b".

#### `pub fn opt(
&mut self,
short_name: &str,
long_name: &str,
desc: &str,
hint: &str,
hasarg: HasArg,
occur: Occur
) -> &mut Options`
[src]

🔬 This is a nightly-only experimental API. (`rustc_private`)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?

Create a generic option group, stating all parameters explicitly.

#### `pub fn optflag(
&mut self,
short_name: &str,
long_name: &str,
desc: &str
) -> &mut Options`
[src]

🔬 This is a nightly-only experimental API. (`rustc_private`)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?

Create a long option that is optional and does not take an argument.

- `short_name` - e.g. `"h"` for a `-h` option, or `""` for none
- `long_name` - e.g. `"help"` for a `--help` option, or `""` for none
- `desc` - Description for usage help

#### `pub fn optflagmulti(
&mut self,
short_name: &str,
long_name: &str,
desc: &str
) -> &mut Options`
[src]

🔬 This is a nightly-only experimental API. (`rustc_private`)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?

Create a long option that can occur more than once and does not take an argument.

- `short_name` - e.g. `"h"` for a `-h` option, or `""` for none
- `long_name` - e.g. `"help"` for a `--help` option, or `""` for none
- `desc` - Description for usage help

#### `pub fn optflagopt(
&mut self,
short_name: &str,
long_name: &str,
desc: &str,
hint: &str
) -> &mut Options`
[src]

🔬 This is a nightly-only experimental API. (`rustc_private`)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?

Create a long option that is optional and takes an optional argument.

- `short_name` - e.g. `"h"` for a `-h` option, or `""` for none
- `long_name` - e.g. `"help"` for a `--help` option, or `""` for none
- `desc` - Description for usage help
- `hint` - Hint that is used in place of the argument in the usage help, e.g. `"FILE"` for a `-o FILE` option

#### `pub fn optmulti(
&mut self,
short_name: &str,
long_name: &str,
desc: &str,
hint: &str
) -> &mut Options`
[src]

🔬 This is a nightly-only experimental API. (`rustc_private`)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?

Create a long option that is optional, takes an argument, and may occur multiple times.

- `short_name` - e.g. `"h"` for a `-h` option, or `""` for none
- `long_name` - e.g. `"help"` for a `--help` option, or `""` for none
- `desc` - Description for usage help
- `hint` - Hint that is used in place of the argument in the usage help, e.g. `"FILE"` for a `-o FILE` option

#### `pub fn optopt(
&mut self,
short_name: &str,
long_name: &str,
desc: &str,
hint: &str
) -> &mut Options`
[src]

🔬 This is a nightly-only experimental API. (`rustc_private`)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?

Create a long option that is optional and takes an argument.

- `short_name` - e.g. `"h"` for a `-h` option, or `""` for none
- `long_name` - e.g. `"help"` for a `--help` option, or `""` for none
- `desc` - Description for usage help
- `hint` - Hint that is used in place of the argument in the usage help, e.g. `"FILE"` for a `-o FILE` option

#### `pub fn reqopt(
&mut self,
short_name: &str,
long_name: &str,
desc: &str,
hint: &str
) -> &mut Options`
[src]

🔬 This is a nightly-only experimental API. (`rustc_private`)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?

Create a long option that is required and takes an argument.

- `short_name` - e.g. `"h"` for a `-h` option, or `""` for none
- `long_name` - e.g. `"help"` for a `--help` option, or `""` for none
- `desc` - Description for usage help
- `hint` - Hint that is used in place of the argument in the usage help, e.g. `"FILE"` for a `-o FILE` option

#### `pub fn parse<C: IntoIterator>(&self, args: C) -> Result where
C::Item: AsRef<OsStr>,`
[src]

🔬 This is a nightly-only experimental API. (`rustc_private`)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?

Parse command line arguments according to the provided options.

On success returns `Ok(Matches)`. Use methods such as `opt_present` `opt_str`, etc. to interrogate results.

# Panics

Returns `Err(Fail)` on failure: use the `Debug` implementation of `Fail` to display information about it.

#### `pub fn short_usage(&self, program_name: &str) -> String`
[src]

🔬 This is a nightly-only experimental API. (`rustc_private`)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?

Derive a short one-line usage summary from a set of long options.

#### `pub fn usage(&self, brief: &str) -> String`
[src]

🔬 This is a nightly-only experimental API. (`rustc_private`)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?

Derive a usage message from a set of options.

## Trait Implementations

## Auto Trait Implementations

### `impl Send for Options`

### `impl Sync for Options`

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)