W3cubDocs

/Pony

_Option

[Source]

class ref _Option

Constructors

create

[Source]

new ref create(
  long': String val,
  short': (String val | None val),
  arg': (None val | StringArgument val | I64Argument val | 
    U64Argument val | F64Argument val),
  mode': (Required val | Optional val))
: _Option ref^

Parameters

Returns

Public fields

let long: String val

[Source]

Long option name.

E.g. "help" for a "--help" option.

let short: (String val | None val)

[Source]

Short option name (if any).

E.g. "h" for a "-h" option.

let arg: (None val | StringArgument val | I64Argument val |

[U64Argument](options-U64Argument.md) val | [F64Argument](options-F64Argument.md) val)

[Source]

The type of the expected argument.

None, if this option is a flag.

E.g. "--help"

let mode: (Required val | Optional val)

[Source]

determining if this Option is required or optional

Public Functions

matches

[Source]

fun box matches(
  name: String box,
  shortmatch: Bool val)
: Bool val

Parameters

Returns

has_argument

[Source]

fun box has_argument()
: Bool val

Returns

requires_argument

[Source]

fun box requires_argument()
: Bool val

Returns

accepts

[Source]

fun box accepts(
  argument: String box)
: Bool val

Parameters

Returns

© 2016-2018, The Pony Developers
© 2014-2015, Causality Ltd.
Licensed under the BSD 2-Clause License.
https://stdlib.ponylang.io/options-_Option