2019-08-30 00:52:32 +02:00
|
|
|
use crate::commands::PerItemCommand;
|
2019-12-04 20:52:31 +01:00
|
|
|
use crate::data::command_dict;
|
2020-01-17 23:46:18 +01:00
|
|
|
|
2019-08-30 00:52:32 +02:00
|
|
|
use crate::prelude::*;
|
Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 03:30:48 +01:00
|
|
|
use nu_errors::ShellError;
|
|
|
|
use nu_protocol::{
|
|
|
|
CallInfo, NamedType, PositionalType, Primitive, ReturnSuccess, Signature, SyntaxShape,
|
2019-12-04 20:52:31 +01:00
|
|
|
TaggedDictBuilder, UntaggedValue, Value,
|
Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 03:30:48 +01:00
|
|
|
};
|
2019-11-21 15:33:14 +01:00
|
|
|
use nu_source::SpannedItem;
|
2019-12-09 19:52:01 +01:00
|
|
|
use nu_value_ext::get_data_by_key;
|
2019-08-30 00:52:32 +02:00
|
|
|
|
|
|
|
pub struct Help;
|
|
|
|
|
|
|
|
impl PerItemCommand for Help {
|
|
|
|
fn name(&self) -> &str {
|
|
|
|
"help"
|
|
|
|
}
|
|
|
|
|
Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 03:30:48 +01:00
|
|
|
fn signature(&self) -> Signature {
|
2019-10-28 06:15:35 +01:00
|
|
|
Signature::build("help").rest(SyntaxShape::Any, "the name of command(s) to get help on")
|
2019-08-30 00:52:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
fn usage(&self) -> &str {
|
|
|
|
"Display help information about commands."
|
|
|
|
}
|
|
|
|
|
|
|
|
fn run(
|
|
|
|
&self,
|
|
|
|
call_info: &CallInfo,
|
2019-09-03 11:36:23 +02:00
|
|
|
registry: &CommandRegistry,
|
2019-08-30 00:52:32 +02:00
|
|
|
_raw_args: &RawCommandArgs,
|
2019-11-21 15:33:14 +01:00
|
|
|
_input: Value,
|
2019-08-30 00:52:32 +02:00
|
|
|
) -> Result<OutputStream, ShellError> {
|
2019-10-13 06:12:43 +02:00
|
|
|
let tag = &call_info.name_tag;
|
2019-08-30 00:52:32 +02:00
|
|
|
|
2019-09-24 09:56:03 +02:00
|
|
|
match call_info.args.nth(0) {
|
2019-11-21 15:33:14 +01:00
|
|
|
Some(Value {
|
|
|
|
value: UntaggedValue::Primitive(Primitive::String(document)),
|
2019-09-03 11:36:23 +02:00
|
|
|
tag,
|
2019-09-24 09:56:03 +02:00
|
|
|
}) => {
|
2019-09-12 20:29:16 +02:00
|
|
|
let mut help = VecDeque::new();
|
2019-09-03 11:36:23 +02:00
|
|
|
if document == "commands" {
|
Restructure and streamline token expansion (#1123)
Restructure and streamline token expansion
The purpose of this commit is to streamline the token expansion code, by
removing aspects of the code that are no longer relevant, removing
pointless duplication, and eliminating the need to pass the same
arguments to `expand_syntax`.
The first big-picture change in this commit is that instead of a handful
of `expand_` functions, which take a TokensIterator and ExpandContext, a
smaller number of methods on the `TokensIterator` do the same job.
The second big-picture change in this commit is fully eliminating the
coloring traits, making coloring a responsibility of the base expansion
implementations. This also means that the coloring tracer is merged into
the expansion tracer, so you can follow a single expansion and see how
the expansion process produced colored tokens.
One side effect of this change is that the expander itself is marginally
more error-correcting. The error correction works by switching from
structured expansion to `BackoffColoringMode` when an unexpected token
is found, which guarantees that all spans of the source are colored, but
may not be the most optimal error recovery strategy.
That said, because `BackoffColoringMode` only extends as far as a
closing delimiter (`)`, `]`, `}`) or pipe (`|`), it does result in
fairly granular correction strategy.
The current code still produces an `Err` (plus a complete list of
colored shapes) from the parsing process if any errors are encountered,
but this could easily be addressed now that the underlying expansion is
error-correcting.
This commit also colors any spans that are syntax errors in red, and
causes the parser to include some additional information about what
tokens were expected at any given point where an error was encountered,
so that completions and hinting could be more robust in the future.
Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
Co-authored-by: Andrés N. Robalino <andres@androbtech.com>
2020-01-21 23:45:03 +01:00
|
|
|
let mut sorted_names = registry.names();
|
2019-09-12 20:29:16 +02:00
|
|
|
sorted_names.sort();
|
|
|
|
for cmd in sorted_names {
|
|
|
|
let mut short_desc = TaggedDictBuilder::new(tag.clone());
|
2020-01-02 05:02:46 +01:00
|
|
|
let value = command_dict(
|
Restructure and streamline token expansion (#1123)
Restructure and streamline token expansion
The purpose of this commit is to streamline the token expansion code, by
removing aspects of the code that are no longer relevant, removing
pointless duplication, and eliminating the need to pass the same
arguments to `expand_syntax`.
The first big-picture change in this commit is that instead of a handful
of `expand_` functions, which take a TokensIterator and ExpandContext, a
smaller number of methods on the `TokensIterator` do the same job.
The second big-picture change in this commit is fully eliminating the
coloring traits, making coloring a responsibility of the base expansion
implementations. This also means that the coloring tracer is merged into
the expansion tracer, so you can follow a single expansion and see how
the expansion process produced colored tokens.
One side effect of this change is that the expander itself is marginally
more error-correcting. The error correction works by switching from
structured expansion to `BackoffColoringMode` when an unexpected token
is found, which guarantees that all spans of the source are colored, but
may not be the most optimal error recovery strategy.
That said, because `BackoffColoringMode` only extends as far as a
closing delimiter (`)`, `]`, `}`) or pipe (`|`), it does result in
fairly granular correction strategy.
The current code still produces an `Err` (plus a complete list of
colored shapes) from the parsing process if any errors are encountered,
but this could easily be addressed now that the underlying expansion is
error-correcting.
This commit also colors any spans that are syntax errors in red, and
causes the parser to include some additional information about what
tokens were expected at any given point where an error was encountered,
so that completions and hinting could be more robust in the future.
Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
Co-authored-by: Andrés N. Robalino <andres@androbtech.com>
2020-01-21 23:45:03 +01:00
|
|
|
registry.get_command(&cmd).ok_or_else(|| {
|
2020-01-02 05:02:46 +01:00
|
|
|
ShellError::labeled_error(
|
|
|
|
format!("Could not load {}", cmd),
|
|
|
|
"could not load command",
|
|
|
|
tag,
|
|
|
|
)
|
|
|
|
})?,
|
|
|
|
tag.clone(),
|
|
|
|
);
|
2019-09-03 11:36:23 +02:00
|
|
|
|
2019-11-21 15:33:14 +01:00
|
|
|
short_desc.insert_untagged("name", cmd);
|
|
|
|
short_desc.insert_untagged(
|
2019-09-03 11:36:23 +02:00
|
|
|
"description",
|
Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 03:30:48 +01:00
|
|
|
get_data_by_key(&value, "usage".spanned_unknown())
|
2020-01-02 05:02:46 +01:00
|
|
|
.ok_or_else(|| {
|
|
|
|
ShellError::labeled_error(
|
|
|
|
"Expected a usage key",
|
|
|
|
"expected a 'usage' key",
|
|
|
|
&value.tag,
|
|
|
|
)
|
|
|
|
})?
|
|
|
|
.as_string()?,
|
2019-09-03 11:36:23 +02:00
|
|
|
);
|
|
|
|
|
2019-11-21 15:33:14 +01:00
|
|
|
help.push_back(ReturnSuccess::value(short_desc.into_value()));
|
2019-09-03 11:36:23 +02:00
|
|
|
}
|
Restructure and streamline token expansion (#1123)
Restructure and streamline token expansion
The purpose of this commit is to streamline the token expansion code, by
removing aspects of the code that are no longer relevant, removing
pointless duplication, and eliminating the need to pass the same
arguments to `expand_syntax`.
The first big-picture change in this commit is that instead of a handful
of `expand_` functions, which take a TokensIterator and ExpandContext, a
smaller number of methods on the `TokensIterator` do the same job.
The second big-picture change in this commit is fully eliminating the
coloring traits, making coloring a responsibility of the base expansion
implementations. This also means that the coloring tracer is merged into
the expansion tracer, so you can follow a single expansion and see how
the expansion process produced colored tokens.
One side effect of this change is that the expander itself is marginally
more error-correcting. The error correction works by switching from
structured expansion to `BackoffColoringMode` when an unexpected token
is found, which guarantees that all spans of the source are colored, but
may not be the most optimal error recovery strategy.
That said, because `BackoffColoringMode` only extends as far as a
closing delimiter (`)`, `]`, `}`) or pipe (`|`), it does result in
fairly granular correction strategy.
The current code still produces an `Err` (plus a complete list of
colored shapes) from the parsing process if any errors are encountered,
but this could easily be addressed now that the underlying expansion is
error-correcting.
This commit also colors any spans that are syntax errors in red, and
causes the parser to include some additional information about what
tokens were expected at any given point where an error was encountered,
so that completions and hinting could be more robust in the future.
Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
Co-authored-by: Andrés N. Robalino <andres@androbtech.com>
2020-01-21 23:45:03 +01:00
|
|
|
} else if let Some(command) = registry.get_command(document) {
|
2020-01-17 23:46:18 +01:00
|
|
|
return Ok(
|
|
|
|
get_help(&command.name(), &command.usage(), command.signature()).into(),
|
|
|
|
);
|
2019-09-03 11:36:23 +02:00
|
|
|
}
|
Futures v0.3 upgrade (#1344)
* Upgrade futures, async-stream, and futures_codec
These were the last three dependencies on futures-preview. `nu` itself
is now fully dependent on `futures@0.3`, as opposed to `futures-preview`
alpha.
Because the update to `futures` from `0.3.0-alpha.19` to `0.3.0` removed
the `Stream` implementation of `VecDeque` ([changelog][changelog]), most
commands that convert a `VecDeque` to an `OutputStream` broke and had to
be fixed.
The current solution is to now convert `VecDeque`s to a `Stream` via
`futures::stream::iter`. However, it may be useful for `futures` to
create an `IntoStream` trait, implemented on the `std::collections` (or
really any `IntoIterator`). If something like this happends, it may be
worthwhile to update the trait implementations on `OutputStream` and
refactor these commands again.
While upgrading `futures_codec`, we remove a custom implementation of
`LinesCodec`, as one has been added to the library. There's also a small
refactor to make the stream output more idiomatic.
[changelog]: https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md#030---2019-11-5
* Upgrade sys & ps plugin dependencies
They were previously dependent on `futures-preview`, and `nu_plugin_ps`
was dependent on an old version of `futures-timer`.
* Remove dependency on futures-timer from nu
* Update Cargo.lock
* Fix formatting
* Revert fmt regressions
CI is still on 1.40.0, but the latest rustfmt v1.41.0 has changes to the
`val @ pattern` syntax, causing the linting job to fail.
* Fix clippy warnings
2020-02-06 04:46:48 +01:00
|
|
|
let help = futures::stream::iter(help);
|
2019-09-12 20:29:16 +02:00
|
|
|
Ok(help.to_output_stream())
|
|
|
|
}
|
|
|
|
_ => {
|
|
|
|
let msg = r#"Welcome to Nushell.
|
2019-09-12 20:33:52 +02:00
|
|
|
|
2019-09-12 20:29:16 +02:00
|
|
|
Here are some tips to help you get started.
|
2019-09-12 20:33:52 +02:00
|
|
|
* help commands - list all available commands
|
|
|
|
* help <command name> - display help about a particular command
|
|
|
|
|
2020-01-31 05:13:14 +01:00
|
|
|
Nushell works on the idea of a "pipeline". Pipelines are commands connected with the '|' character. Each stage
|
|
|
|
in the pipeline works together to load, parse, and display information to you.
|
|
|
|
|
|
|
|
[Examples]
|
|
|
|
|
|
|
|
List the files in the current directory, sorted by size:
|
|
|
|
ls | sort-by size
|
|
|
|
|
|
|
|
Get information about the current system:
|
|
|
|
sys | get host
|
|
|
|
|
|
|
|
Get the processes on your system actively using CPU:
|
|
|
|
ps | where cpu > 0
|
|
|
|
|
2019-12-15 13:56:26 +01:00
|
|
|
You can also learn more at https://www.nushell.sh/book/"#;
|
2019-09-12 20:29:16 +02:00
|
|
|
|
Futures v0.3 upgrade (#1344)
* Upgrade futures, async-stream, and futures_codec
These were the last three dependencies on futures-preview. `nu` itself
is now fully dependent on `futures@0.3`, as opposed to `futures-preview`
alpha.
Because the update to `futures` from `0.3.0-alpha.19` to `0.3.0` removed
the `Stream` implementation of `VecDeque` ([changelog][changelog]), most
commands that convert a `VecDeque` to an `OutputStream` broke and had to
be fixed.
The current solution is to now convert `VecDeque`s to a `Stream` via
`futures::stream::iter`. However, it may be useful for `futures` to
create an `IntoStream` trait, implemented on the `std::collections` (or
really any `IntoIterator`). If something like this happends, it may be
worthwhile to update the trait implementations on `OutputStream` and
refactor these commands again.
While upgrading `futures_codec`, we remove a custom implementation of
`LinesCodec`, as one has been added to the library. There's also a small
refactor to make the stream output more idiomatic.
[changelog]: https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md#030---2019-11-5
* Upgrade sys & ps plugin dependencies
They were previously dependent on `futures-preview`, and `nu_plugin_ps`
was dependent on an old version of `futures-timer`.
* Remove dependency on futures-timer from nu
* Update Cargo.lock
* Fix formatting
* Revert fmt regressions
CI is still on 1.40.0, but the latest rustfmt v1.41.0 has changes to the
`val @ pattern` syntax, causing the linting job to fail.
* Fix clippy warnings
2020-02-06 04:46:48 +01:00
|
|
|
let output_stream = futures::stream::iter(vec![ReturnSuccess::value(
|
2019-12-04 20:52:31 +01:00
|
|
|
UntaggedValue::string(msg).into_value(tag),
|
Futures v0.3 upgrade (#1344)
* Upgrade futures, async-stream, and futures_codec
These were the last three dependencies on futures-preview. `nu` itself
is now fully dependent on `futures@0.3`, as opposed to `futures-preview`
alpha.
Because the update to `futures` from `0.3.0-alpha.19` to `0.3.0` removed
the `Stream` implementation of `VecDeque` ([changelog][changelog]), most
commands that convert a `VecDeque` to an `OutputStream` broke and had to
be fixed.
The current solution is to now convert `VecDeque`s to a `Stream` via
`futures::stream::iter`. However, it may be useful for `futures` to
create an `IntoStream` trait, implemented on the `std::collections` (or
really any `IntoIterator`). If something like this happends, it may be
worthwhile to update the trait implementations on `OutputStream` and
refactor these commands again.
While upgrading `futures_codec`, we remove a custom implementation of
`LinesCodec`, as one has been added to the library. There's also a small
refactor to make the stream output more idiomatic.
[changelog]: https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md#030---2019-11-5
* Upgrade sys & ps plugin dependencies
They were previously dependent on `futures-preview`, and `nu_plugin_ps`
was dependent on an old version of `futures-timer`.
* Remove dependency on futures-timer from nu
* Update Cargo.lock
* Fix formatting
* Revert fmt regressions
CI is still on 1.40.0, but the latest rustfmt v1.41.0 has changes to the
`val @ pattern` syntax, causing the linting job to fail.
* Fix clippy warnings
2020-02-06 04:46:48 +01:00
|
|
|
)]);
|
2019-09-12 20:29:16 +02:00
|
|
|
|
|
|
|
Ok(output_stream.to_output_stream())
|
2019-09-03 11:36:23 +02:00
|
|
|
}
|
2019-08-30 00:52:32 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-01-17 23:46:18 +01:00
|
|
|
|
|
|
|
pub(crate) fn get_help(
|
|
|
|
cmd_name: &str,
|
|
|
|
cmd_usage: &str,
|
|
|
|
cmd_sig: Signature,
|
|
|
|
) -> impl Into<OutputStream> {
|
|
|
|
let mut help = VecDeque::new();
|
|
|
|
let mut long_desc = String::new();
|
|
|
|
|
|
|
|
long_desc.push_str(&cmd_usage);
|
|
|
|
long_desc.push_str("\n");
|
|
|
|
|
|
|
|
let signature = cmd_sig;
|
|
|
|
|
|
|
|
let mut one_liner = String::new();
|
|
|
|
one_liner.push_str(&signature.name);
|
|
|
|
one_liner.push_str(" ");
|
|
|
|
|
|
|
|
for positional in &signature.positional {
|
|
|
|
match &positional.0 {
|
|
|
|
PositionalType::Mandatory(name, _m) => {
|
|
|
|
one_liner.push_str(&format!("<{}> ", name));
|
|
|
|
}
|
|
|
|
PositionalType::Optional(name, _o) => {
|
|
|
|
one_liner.push_str(&format!("({}) ", name));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if signature.rest_positional.is_some() {
|
|
|
|
one_liner.push_str(" ...args");
|
|
|
|
}
|
|
|
|
|
|
|
|
if !signature.named.is_empty() {
|
|
|
|
one_liner.push_str("{flags} ");
|
|
|
|
}
|
|
|
|
|
|
|
|
long_desc.push_str(&format!("\nUsage:\n > {}\n", one_liner));
|
|
|
|
|
|
|
|
if !signature.positional.is_empty() || signature.rest_positional.is_some() {
|
|
|
|
long_desc.push_str("\nparameters:\n");
|
|
|
|
for positional in signature.positional {
|
|
|
|
match positional.0 {
|
|
|
|
PositionalType::Mandatory(name, _m) => {
|
|
|
|
long_desc.push_str(&format!(" <{}> {}\n", name, positional.1));
|
|
|
|
}
|
|
|
|
PositionalType::Optional(name, _o) => {
|
|
|
|
long_desc.push_str(&format!(" ({}) {}\n", name, positional.1));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if let Some(rest_positional) = signature.rest_positional {
|
|
|
|
long_desc.push_str(&format!(" ...args: {}\n", rest_positional.1));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if !signature.named.is_empty() {
|
|
|
|
long_desc.push_str("\nflags:\n");
|
|
|
|
for (flag, ty) in signature.named {
|
2020-02-12 03:24:31 +01:00
|
|
|
let msg = match ty.0 {
|
|
|
|
NamedType::Switch(s) => {
|
|
|
|
if let Some(c) = s {
|
|
|
|
format!(
|
|
|
|
" -{}, --{}{} {}\n",
|
|
|
|
c,
|
|
|
|
flag,
|
|
|
|
if !ty.1.is_empty() { ":" } else { "" },
|
|
|
|
ty.1
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
format!(
|
|
|
|
" --{}{} {}\n",
|
|
|
|
flag,
|
|
|
|
if !ty.1.is_empty() { ":" } else { "" },
|
|
|
|
ty.1
|
|
|
|
)
|
|
|
|
}
|
2020-01-17 23:46:18 +01:00
|
|
|
}
|
2020-02-12 03:24:31 +01:00
|
|
|
NamedType::Mandatory(s, m) => {
|
|
|
|
if let Some(c) = s {
|
|
|
|
format!(
|
|
|
|
" -{}, --{} <{}> (required parameter){} {}\n",
|
|
|
|
c,
|
|
|
|
flag,
|
|
|
|
m.display(),
|
|
|
|
if !ty.1.is_empty() { ":" } else { "" },
|
|
|
|
ty.1
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
format!(
|
|
|
|
" --{} <{}> (required parameter){} {}\n",
|
|
|
|
flag,
|
|
|
|
m.display(),
|
|
|
|
if !ty.1.is_empty() { ":" } else { "" },
|
|
|
|
ty.1
|
|
|
|
)
|
|
|
|
}
|
2020-01-17 23:46:18 +01:00
|
|
|
}
|
2020-02-12 03:24:31 +01:00
|
|
|
NamedType::Optional(s, o) => {
|
|
|
|
if let Some(c) = s {
|
|
|
|
format!(
|
|
|
|
" -{}, --{} <{}>{} {}\n",
|
|
|
|
c,
|
|
|
|
flag,
|
|
|
|
o.display(),
|
|
|
|
if !ty.1.is_empty() { ":" } else { "" },
|
|
|
|
ty.1
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
format!(
|
|
|
|
" --{} <{}>{} {}\n",
|
|
|
|
flag,
|
|
|
|
o.display(),
|
|
|
|
if !ty.1.is_empty() { ":" } else { "" },
|
|
|
|
ty.1
|
|
|
|
)
|
|
|
|
}
|
2020-01-17 23:46:18 +01:00
|
|
|
}
|
2020-02-12 03:24:31 +01:00
|
|
|
};
|
|
|
|
long_desc.push_str(&msg);
|
2020-01-17 23:46:18 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
help.push_back(ReturnSuccess::value(
|
|
|
|
UntaggedValue::string(long_desc).into_value(Tag::from((0, cmd_name.len(), None))),
|
|
|
|
));
|
|
|
|
help
|
|
|
|
}
|