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:
Joseph T. Lyons
2020-06-30 00:12:51 -04:00
committed by GitHub
parent ed10aafa6f
commit 9876169f5d
7 changed files with 168 additions and 14 deletions

View File

@ -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
───┬────
011
111
211
311
45
53
610
77
83
91
───┴────
```
## uuid
* `random uuid`: Generate a random uuid4 string
### uuid Examples
```shell
> random uuid
8af4de39-acbc-42f0-94d1-7cfad6c01f8b
```