droll-cli

droll-cli parses the dice notation by utilizing a operator-precedence parser according to the following grammar rules (The grammar is EBNF format).

``` ::= | '+' | '-'

::= | 'd'

::= | '+' | '-' | 'd'

::= { }

::= '1' .. '9'

::= '0' .. '9' ```

Installation

To install droll-cli, you can use the Rust package manager, Cargo, with the following command:

cargo install droll

Usage

After installing droll-cli, you can use it by calling it from the shell with the desired dice notation:

droll <dice_notation>

Replace with actual dice notation like 1d20+10.

Standard dice notation

The simplest dice notation is called standard dice notation and it supports simple dice rolls like d6, 2d20 and also additive operations like 2d20+10-2.

To calculate the roll result, simply call the droll with the desired dice notation:

droll 1d20+10 27