mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 03:38:07 +02:00
Experiment: Allow both $true/true and $false/false (#4696)
* Change true/false to keywords * oops, clippy * Both kinds of bools * Add in some boolean variables * disable py virtualenv test for now
This commit is contained in:
@ -61,7 +61,7 @@ impl Command for SubCommand {
|
||||
},
|
||||
Example {
|
||||
description: "convert a boolean to a nushell binary primitive",
|
||||
example: "$true | into binary",
|
||||
example: "true | into binary",
|
||||
result: Some(Value::Binary {
|
||||
val: i64::from(1).to_le_bytes().to_vec(),
|
||||
span: Span::test_data(),
|
||||
|
@ -42,7 +42,7 @@ impl Command for SubCommand {
|
||||
vec![
|
||||
Example {
|
||||
description: "Convert value to boolean in table",
|
||||
example: "echo [[value]; ['false'] ['1'] [0] [1.0] [$true]] | into bool value",
|
||||
example: "echo [[value]; ['false'] ['1'] [0] [1.0] [true]] | into bool value",
|
||||
result: Some(Value::List {
|
||||
vals: vec![
|
||||
Value::Record {
|
||||
@ -76,7 +76,7 @@ impl Command for SubCommand {
|
||||
},
|
||||
Example {
|
||||
description: "Convert bool to boolean",
|
||||
example: "$true | into bool",
|
||||
example: "true | into bool",
|
||||
result: Some(Value::boolean(true, span)),
|
||||
},
|
||||
Example {
|
||||
|
@ -75,7 +75,7 @@ impl Command for SubCommand {
|
||||
},
|
||||
Example {
|
||||
description: "Convert bool to integer",
|
||||
example: "[$false, $true] | into int",
|
||||
example: "[false, true] | into int",
|
||||
result: Some(Value::List {
|
||||
vals: vec![Value::test_int(0), Value::test_int(1)],
|
||||
span: Span::test_data(),
|
||||
|
@ -103,7 +103,7 @@ impl Command for SubCommand {
|
||||
},
|
||||
Example {
|
||||
description: "convert boolean to string",
|
||||
example: "$true | into string",
|
||||
example: "true | into string",
|
||||
result: Some(Value::String {
|
||||
val: "true".to_string(),
|
||||
span: Span::test_data(),
|
||||
|
Reference in New Issue
Block a user