mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
Add long options for bits and bytes (#10601)
As discussed in https://github.com/nushell/nushell/pull/10597#issuecomment-1745692687
This commit is contained in:
@ -96,7 +96,7 @@ impl Command for BitsNot {
|
||||
Example {
|
||||
description:
|
||||
"Apply logical negation to a list of numbers, treat input as 2 bytes number",
|
||||
example: "[4 3 2] | bits not -n '2'",
|
||||
example: "[4 3 2] | bits not --number-bytes '2'",
|
||||
result: Some(Value::list(
|
||||
vec![
|
||||
Value::test_int(65531),
|
||||
@ -109,7 +109,7 @@ impl Command for BitsNot {
|
||||
Example {
|
||||
description:
|
||||
"Apply logical negation to a list of numbers, treat input as signed number",
|
||||
example: "[4 3 2] | bits not -s",
|
||||
example: "[4 3 2] | bits not --signed",
|
||||
result: Some(Value::list(
|
||||
vec![
|
||||
Value::test_int(-5),
|
||||
|
@ -90,7 +90,7 @@ impl Command for BitsRor {
|
||||
},
|
||||
Example {
|
||||
description: "Rotate right a list of numbers of one byte",
|
||||
example: "[15 33 92] | bits ror 2 -n '1'",
|
||||
example: "[15 33 92] | bits ror 2 --number-bytes '1'",
|
||||
result: Some(Value::list(
|
||||
vec![
|
||||
Value::test_int(195),
|
||||
|
@ -90,12 +90,12 @@ impl Command for BitsShl {
|
||||
},
|
||||
Example {
|
||||
description: "Shift left a number with 1 byte by 7 bits",
|
||||
example: "2 | bits shl 7 -n '1'",
|
||||
example: "2 | bits shl 7 --number-bytes '1'",
|
||||
result: Some(Value::test_int(0)),
|
||||
},
|
||||
Example {
|
||||
description: "Shift left a signed number by 1 bit",
|
||||
example: "0x7F | bits shl 1 -s",
|
||||
example: "0x7F | bits shl 1 --signed",
|
||||
result: Some(Value::test_int(254)),
|
||||
},
|
||||
Example {
|
||||
|
Reference in New Issue
Block a user