diff --git a/crates/nu-cmd-extra/src/extra/bits/not.rs b/crates/nu-cmd-extra/src/extra/bits/not.rs index 2e50df6005..61025d27bf 100644 --- a/crates/nu-cmd-extra/src/extra/bits/not.rs +++ b/crates/nu-cmd-extra/src/extra/bits/not.rs @@ -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), diff --git a/crates/nu-cmd-extra/src/extra/bits/rotate_right.rs b/crates/nu-cmd-extra/src/extra/bits/rotate_right.rs index 4bd44b1aeb..18942db674 100644 --- a/crates/nu-cmd-extra/src/extra/bits/rotate_right.rs +++ b/crates/nu-cmd-extra/src/extra/bits/rotate_right.rs @@ -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), diff --git a/crates/nu-cmd-extra/src/extra/bits/shift_left.rs b/crates/nu-cmd-extra/src/extra/bits/shift_left.rs index f7663ca855..b2a46d687d 100644 --- a/crates/nu-cmd-extra/src/extra/bits/shift_left.rs +++ b/crates/nu-cmd-extra/src/extra/bits/shift_left.rs @@ -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 { diff --git a/crates/nu-command/src/bytes/add.rs b/crates/nu-command/src/bytes/add.rs index 3cfd989c96..7d9d591e7c 100644 --- a/crates/nu-command/src/bytes/add.rs +++ b/crates/nu-command/src/bytes/add.rs @@ -97,21 +97,21 @@ impl Command for BytesAdd { }, Example { description: "Add bytes `0x[AA BB]` to `0x[1F FF AA AA]` at index 1", - example: "0x[1F FF AA AA] | bytes add 0x[AA BB] -i 1", + example: "0x[1F FF AA AA] | bytes add 0x[AA BB] --index 1", result: Some(Value::binary(vec![0x1F, 0xAA, 0xBB, 0xFF, 0xAA, 0xAA], Span::test_data(), )), }, Example { description: "Add bytes `0x[11]` to `0x[FF AA AA]` at the end", - example: "0x[FF AA AA] | bytes add 0x[11] -e", + example: "0x[FF AA AA] | bytes add 0x[11] --end", result: Some(Value::binary(vec![0xFF, 0xAA, 0xAA, 0x11], Span::test_data(), )), }, Example { description: "Add bytes `0x[11 22 33]` to `0x[FF AA AA]` at the end, at index 1(the index is start from end)", - example: "0x[FF AA BB] | bytes add 0x[11 22 33] -e -i 1", + example: "0x[FF AA BB] | bytes add 0x[11 22 33] --end --index 1", result: Some(Value::binary(vec![0xFF, 0xAA, 0x11, 0x22, 0x33, 0xBB], Span::test_data(), )), diff --git a/crates/nu-command/src/bytes/index_of.rs b/crates/nu-command/src/bytes/index_of.rs index 1b1101daf1..49aa439c39 100644 --- a/crates/nu-command/src/bytes/index_of.rs +++ b/crates/nu-command/src/bytes/index_of.rs @@ -89,12 +89,12 @@ impl Command for BytesIndexOf { }, Example { description: "Returns index of pattern, search from end", - example: " 0x[33 44 55 10 01 13 44 55] | bytes index-of -e 0x[44 55]", + example: " 0x[33 44 55 10 01 13 44 55] | bytes index-of --end 0x[44 55]", result: Some(Value::test_int(6)), }, Example { description: "Returns all matched index", - example: " 0x[33 44 55 10 01 33 44 33 44] | bytes index-of -a 0x[33 44]", + example: " 0x[33 44 55 10 01 33 44 33 44] | bytes index-of --all 0x[33 44]", result: Some(Value::list( vec![Value::test_int(0), Value::test_int(5), Value::test_int(7)], Span::test_data(), @@ -102,7 +102,7 @@ impl Command for BytesIndexOf { }, Example { description: "Returns all matched index, searching from end", - example: " 0x[33 44 55 10 01 33 44 33 44] | bytes index-of -a -e 0x[33 44]", + example: " 0x[33 44 55 10 01 33 44 33 44] | bytes index-of --all --end 0x[33 44]", result: Some(Value::list( vec![Value::test_int(7), Value::test_int(5), Value::test_int(0)], Span::test_data(), diff --git a/crates/nu-command/src/bytes/remove.rs b/crates/nu-command/src/bytes/remove.rs index 28b22816e4..61533b2499 100644 --- a/crates/nu-command/src/bytes/remove.rs +++ b/crates/nu-command/src/bytes/remove.rs @@ -94,7 +94,7 @@ impl Command for BytesRemove { }, Example { description: "Remove all occurrences of find binary in record field", - example: "{ data: 0x[10 AA 10 BB 10] } | bytes remove -a 0x[10] data", + example: "{ data: 0x[10 AA 10 BB 10] } | bytes remove --all 0x[10] data", result: Some(Value::test_record(Record { cols: vec!["data".to_string()], vals: vec![Value::test_binary(vec![0xAA, 0xBB])] @@ -102,7 +102,7 @@ impl Command for BytesRemove { }, Example { description: "Remove occurrences of find binary from end", - example: "0x[10 AA 10 BB CC AA 10] | bytes remove -e 0x[10]", + example: "0x[10 AA 10 BB CC AA 10] | bytes remove --end 0x[10]", result: Some(Value::binary ( vec![0x10, 0xAA, 0x10, 0xBB, 0xCC, 0xAA], Span::test_data(), diff --git a/crates/nu-command/src/bytes/replace.rs b/crates/nu-command/src/bytes/replace.rs index b811a20a14..f0244f0149 100644 --- a/crates/nu-command/src/bytes/replace.rs +++ b/crates/nu-command/src/bytes/replace.rs @@ -94,7 +94,7 @@ impl Command for BytesReplace { }, Example { description: "Find and replace all occurrences of find binary", - example: "0x[10 AA 10 BB 10] | bytes replace -a 0x[10] 0x[A0]", + example: "0x[10 AA 10 BB 10] | bytes replace --all 0x[10] 0x[A0]", result: Some(Value::binary ( vec![0xA0, 0xAA, 0xA0, 0xBB, 0xA0], Span::test_data(), @@ -102,7 +102,7 @@ impl Command for BytesReplace { }, Example { description: "Find and replace all occurrences of find binary in table", - example: "[[ColA ColB ColC]; [0x[11 12 13] 0x[14 15 16] 0x[17 18 19]]] | bytes replace -a 0x[11] 0x[13] ColA ColC", + example: "[[ColA ColB ColC]; [0x[11 12 13] 0x[14 15 16] 0x[17 18 19]]] | bytes replace --all 0x[11] 0x[13] ColA ColC", result: Some(Value::list ( vec![Value::test_record(Record { cols: vec!["ColA".to_string(), "ColB".to_string(), "ColC".to_string()],