add random commands (#366)

* feat: add random command

* feat: add bool sub-command
This commit is contained in:
Jae-Heon Ji
2021-11-30 15:12:19 +09:00
committed by GitHub
parent ce4d9dc7c6
commit 21ddfc61f4
8 changed files with 154 additions and 1 deletions

View File

@ -76,6 +76,10 @@ pub enum ShellError {
#[diagnostic(code(nu::shell::external_commands), url(docsrs))]
ExternalNotSupported(#[label = "external not supported"] Span),
#[error("Invalid Probability.")]
#[diagnostic(code(nu::shell::invalid_probability), url(docsrs))]
InvalidProbability(#[label = "invalid probability"] Span),
#[error("Internal error: {0}.")]
#[diagnostic(code(nu::shell::internal_error), url(docsrs))]
InternalError(String),

View File

@ -42,6 +42,7 @@ pub enum Category {
Filters,
Formats,
Math,
Random,
Platform,
Shells,
Strings,
@ -63,6 +64,7 @@ impl std::fmt::Display for Category {
Category::Filters => "filters",
Category::Formats => "formats",
Category::Math => "math",
Category::Random => "random",
Category::Platform => "platform",
Category::Shells => "shells",
Category::Strings => "strings",