forked from extern/nushell
Add dice subcommand to random command (#2082)
* Add dice subcommand to random command * Update random dice test name * Stream results of random dice * Thanks Clippy!
This commit is contained in:
@ -2,17 +2,6 @@
|
||||
|
||||
Use `random` to generate random values
|
||||
|
||||
## uuid
|
||||
|
||||
* `random uuid`: Generate a random uuid4 string
|
||||
|
||||
### uuid Examples
|
||||
|
||||
```shell
|
||||
> random uuid
|
||||
8af4de39-acbc-42f0-94d1-7cfad6c01f8b
|
||||
```
|
||||
|
||||
## bool
|
||||
|
||||
* `random bool`: Generate a random boolean value
|
||||
@ -32,3 +21,46 @@ false
|
||||
> random bool --bias 0.75
|
||||
true
|
||||
```
|
||||
|
||||
## dice
|
||||
|
||||
* `random dice`: Generate a random dice roll
|
||||
|
||||
### dice Flags
|
||||
|
||||
* `d`, `--dice` \<integer>: The amount of dice being rolled
|
||||
* `s`, `--sides` \<integer>: The amount of sides a die has
|
||||
|
||||
### dice Examples
|
||||
|
||||
```shell
|
||||
> random dice
|
||||
4
|
||||
```
|
||||
|
||||
```shell
|
||||
> random dice -d 10 -s 12
|
||||
───┬────
|
||||
0 │ 11
|
||||
1 │ 11
|
||||
2 │ 11
|
||||
3 │ 11
|
||||
4 │ 5
|
||||
5 │ 3
|
||||
6 │ 10
|
||||
7 │ 7
|
||||
8 │ 3
|
||||
9 │ 1
|
||||
───┴────
|
||||
```
|
||||
|
||||
## uuid
|
||||
|
||||
* `random uuid`: Generate a random uuid4 string
|
||||
|
||||
### uuid Examples
|
||||
|
||||
```shell
|
||||
> random uuid
|
||||
8af4de39-acbc-42f0-94d1-7cfad6c01f8b
|
||||
```
|
||||
|
Reference in New Issue
Block a user