change describe so it doesn't output colored strings (#3832)

This commit is contained in:
Darren Schroeder 2021-07-24 13:34:11 -05:00 committed by GitHub
parent 2e24de7f47
commit 27f1e7b60c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -31,7 +31,7 @@ pub fn describe(args: CommandArgs) -> Result<ActionStream, ShellError> {
Ok(args
.input
.map(|row| {
let name = value::format_type(&row, 100);
let name = value::plain_type(&row, 100);
ReturnSuccess::value(
UntaggedValue::string(name).into_value(Tag::unknown_anchor(row.tag.span)),
)

View File

@ -537,6 +537,10 @@ pub fn compare_values(
Ok(result)
}
pub fn plain_type<'a>(value: impl Into<&'a UntaggedValue>, width: usize) -> String {
Type::from_value(value.into()).plain_string(width)
}
pub fn format_type<'a>(value: impl Into<&'a UntaggedValue>, width: usize) -> String {
Type::from_value(value.into()).colored_string(width)
}