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:
Hofer-Julian
2023-10-05 18:45:28 +02:00
committed by GitHub
parent a03c1c266c
commit 471c58448e
7 changed files with 15 additions and 15 deletions

View File

@ -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),

View File

@ -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),

View File

@ -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 {