forked from extern/nushell
Set active shell column to boolean (#2540)
This commit is contained in:
parent
45f32c9541
commit
c355585112
@ -37,9 +37,9 @@ fn shells(args: CommandArgs, _registry: &CommandRegistry) -> Result<OutputStream
|
|||||||
let mut dict = TaggedDictBuilder::new(&tag);
|
let mut dict = TaggedDictBuilder::new(&tag);
|
||||||
|
|
||||||
if index == (*args.shell_manager.current_shell).load(Ordering::SeqCst) {
|
if index == (*args.shell_manager.current_shell).load(Ordering::SeqCst) {
|
||||||
dict.insert_untagged("active", "X".to_string());
|
dict.insert_untagged("active", true);
|
||||||
} else {
|
} else {
|
||||||
dict.insert_untagged("active", " ".to_string());
|
dict.insert_untagged("active", false);
|
||||||
}
|
}
|
||||||
dict.insert_untagged("name", shell.name());
|
dict.insert_untagged("name", shell.name());
|
||||||
dict.insert_untagged("path", shell.path());
|
dict.insert_untagged("path", shell.path());
|
||||||
|
@ -136,6 +136,13 @@ impl Primitive {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<bool> for Primitive {
|
||||||
|
/// Helper to convert from boolean to a primitive
|
||||||
|
fn from(b: bool) -> Primitive {
|
||||||
|
Primitive::Boolean(b)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl From<&str> for Primitive {
|
impl From<&str> for Primitive {
|
||||||
/// Helper to convert from string slices to a primitive
|
/// Helper to convert from string slices to a primitive
|
||||||
fn from(s: &str) -> Primitive {
|
fn from(s: &str) -> Primitive {
|
||||||
|
Loading…
Reference in New Issue
Block a user