# ArgSpec
<span class="source-link">[[Source]](src/cli/command_spec.md#L341)</span>

ArgSpec describes the specification of a positional Arg(ument). They have a
name, descr(iption), a typ(e), and a default value when they are not
required.

Args always come after a leaf command, and are assigned in their positional
order.


```pony
class val ArgSpec
```

## Constructors

### bool
<span class="source-link">[[Source]](src/cli/command_spec.md#L364)</span>


Creates an Arg with a Bool typed value that can be used like
  `<cmd> true`
to yield an arg value like
  `cmd.arg("opt").bool() == true`.


```pony
new val bool(
  name': String val,
  descr': String val = seq,
  default': (Bool val | None val) = seq)
: ArgSpec val^
```
#### Parameters

*   name': [String](builtin-String) val
*   descr': [String](builtin-String) val = seq
*   default': ([Bool](builtin-Bool) val | [None](builtin-None) val) = seq

#### Returns

* [ArgSpec](cli-ArgSpec) val^

---

### string
<span class="source-link">[[Source]](src/cli/command_spec.md#L379)</span>


Creates an Arg with a String typed value that can be used like
  `<cmd> filename`
to yield an arg value
  `cmd.arg("file").string() == "filename"`.


```pony
new val string(
  name': String val,
  descr': String val = seq,
  default': (String val | None val) = seq)
: ArgSpec val^
```
#### Parameters

*   name': [String](builtin-String) val
*   descr': [String](builtin-String) val = seq
*   default': ([String](builtin-String) val | [None](builtin-None) val) = seq

#### Returns

* [ArgSpec](cli-ArgSpec) val^

---

### i64
<span class="source-link">[[Source]](src/cli/command_spec.md#L394)</span>


Creates an Arg with an I64 typed value that can be used like
  `<cmd> 42`
to yield an arg value like
  `cmd.arg("count").i64() == I64(42)`.


```pony
new val i64(
  name': String val,
  descr': String val = seq,
  default': (I64 val | None val) = seq)
: ArgSpec val^
```
#### Parameters

*   name': [String](builtin-String) val
*   descr': [String](builtin-String) val = seq
*   default': ([I64](builtin-I64) val | [None](builtin-None) val) = seq

#### Returns

* [ArgSpec](cli-ArgSpec) val^

---

### u64
<span class="source-link">[[Source]](src/cli/command_spec.md#L408)</span>


Creates an Arg with an U64 typed value that can be used like
  `<cmd> 47`
to yield an arg value like
  `cmd.arg("count").u64() == U64(47)`.


```pony
new val u64(
  name': String val,
  descr': String val = seq,
  default': (U64 val | None val) = seq)
: ArgSpec val^
```
#### Parameters

*   name': [String](builtin-String) val
*   descr': [String](builtin-String) val = seq
*   default': ([U64](builtin-U64) val | [None](builtin-None) val) = seq

#### Returns

* [ArgSpec](cli-ArgSpec) val^

---

### f64
<span class="source-link">[[Source]](src/cli/command_spec.md#L422)</span>


Creates an Arg with a F64 typed value that can be used like
  `<cmd> 1.039`
to yield an arg value like
  `cmd.arg("ratio").f64() == F64(1.039)`.


```pony
new val f64(
  name': String val,
  descr': String val = seq,
  default': (F64 val | None val) = seq)
: ArgSpec val^
```
#### Parameters

*   name': [String](builtin-String) val
*   descr': [String](builtin-String) val = seq
*   default': ([F64](builtin-F64) val | [None](builtin-None) val) = seq

#### Returns

* [ArgSpec](cli-ArgSpec) val^

---

### string_seq
<span class="source-link">[[Source]](src/cli/command_spec.md#L436)</span>


Creates an Arg with a ReadSeq[String] typed value that can be used like
  `<cmd> file1 file2 file3`
to yield a sequence of three strings equivalent to
  `cmd.arg("file").string_seq() (equiv) ["file1"; "file2"; "file3"]`.


```pony
new val string_seq(
  name': String val,
  descr': String val = seq)
: ArgSpec val^
```
#### Parameters

*   name': [String](builtin-String) val
*   descr': [String](builtin-String) val = seq

#### Returns

* [ArgSpec](cli-ArgSpec) val^

---

## Public Functions

### name
<span class="source-link">[[Source]](src/cli/command_spec.md#L450)</span>


Returns the name of this arg.


```pony
fun box name()
: String val
```

#### Returns

* [String](builtin-String) val

---

### descr
<span class="source-link">[[Source]](src/cli/command_spec.md#L456)</span>


Returns the description for this arg.


```pony
fun box descr()
: String val
```

#### Returns

* [String](builtin-String) val

---

### required
<span class="source-link">[[Source]](src/cli/command_spec.md#L466)</span>


Returns true iff this arg is required to be present in the command line.


```pony
fun box required()
: Bool val
```

#### Returns

* [Bool](builtin-Bool) val

---

### help_string
<span class="source-link">[[Source]](src/cli/command_spec.md#L472)</span>


Returns a formated help string for this arg.


```pony
fun box help_string()
: String val
```

#### Returns

* [String](builtin-String) val

---

### deb_string
<span class="source-link">[[Source]](src/cli/command_spec.md#L478)</span>


```pony
fun box deb_string()
: String val
```

#### Returns

* [String](builtin-String) val

---

## Private Functions

### _init
<span class="source-link">[[Source]](src/cli/command_spec.md#L356)</span>


```pony
fun tag _init(
  typ': _ValueType val,
  default': (Bool val | String val | I64 val | 
    U64 val | F64 val | _StringSeq val | 
    None val))
: (_ValueType val , (Bool val | String val | I64 val | 
    U64 val | F64 val | _StringSeq val) , Bool val)
```
#### Parameters

*   typ': [_ValueType](cli-_ValueType) val
*   default': ([Bool](builtin-Bool) val | [String](builtin-String) val | [I64](builtin-I64) val | 
    [U64](builtin-U64) val | [F64](builtin-F64) val | [_StringSeq](cli-_StringSeq) val | 
    [None](builtin-None) val)

#### Returns

* ([_ValueType](cli-_ValueType) val , ([Bool](builtin-Bool) val | [String](builtin-String) val | [I64](builtin-I64) val | 
    [U64](builtin-U64) val | [F64](builtin-F64) val | [_StringSeq](cli-_StringSeq) val) , [Bool](builtin-Bool) val)

---

### _typ_p
<span class="source-link">[[Source]](src/cli/command_spec.md#L462)</span>


```pony
fun box _typ_p()
: _ValueType val
```

#### Returns

* [_ValueType](cli-_ValueType) val

---

### _default_p
<span class="source-link">[[Source]](src/cli/command_spec.md#L464)</span>


```pony
fun box _default_p()
: (Bool val | String val | I64 val | 
    U64 val | F64 val | _StringSeq val)
```

#### Returns

* ([Bool](builtin-Bool) val | [String](builtin-String) val | [I64](builtin-I64) val | 
    [U64](builtin-U64) val | [F64](builtin-F64) val | [_StringSeq](cli-_StringSeq) val)

---

