mirror of
https://github.com/nushell/nushell.git
synced 2024-12-23 15:39:06 +01:00
parent
2126bef052
commit
e6570b41ca
@ -59,7 +59,7 @@ impl Command for Compact {
|
||||
}),
|
||||
},
|
||||
Example {
|
||||
description: "Filter out all instances of nothing from a list (Returns [1,2]",
|
||||
description: "Filter out all instances of nothing from a list (Returns [1,2])",
|
||||
example: r#"echo [1, $nothing, 2] | compact"#,
|
||||
result: Some(Value::List {
|
||||
vals: vec![Value::test_int(1), Value::test_int(2)],
|
||||
|
@ -66,7 +66,7 @@ impl Command for Base64 {
|
||||
},
|
||||
Example {
|
||||
description: "Base64 encode a string with the binhex character set",
|
||||
example: "echo 'username:password' | hash base64 --character_set binhex --encode",
|
||||
example: "echo 'username:password' | hash base64 --character-set binhex --encode",
|
||||
result: Some(Value::string("F@0NEPjJD97kE'&bEhFZEP3", Span::test_data())),
|
||||
},
|
||||
Example {
|
||||
|
@ -26,7 +26,7 @@ Filter out all records where 'World' is null (Returns the table)
|
||||
> echo [["Hello" "World"]; [$nothing 3]]| compact World
|
||||
```
|
||||
|
||||
Filter out all instances of nothing from a list (Returns [1,2]
|
||||
Filter out all instances of nothing from a list (Returns [1,2])
|
||||
```shell
|
||||
> echo [1, $nothing, 2] | compact
|
||||
```
|
||||
|
@ -9,3 +9,10 @@ Export custom commands or environment variables from a module.
|
||||
## Signature
|
||||
|
||||
```> export ```
|
||||
|
||||
## Examples
|
||||
|
||||
Export a definition from a module
|
||||
```shell
|
||||
> module utils { export def my-command [] { "hello" } }; use utils my-command; my-command
|
||||
```
|
||||
|
@ -14,3 +14,10 @@ Define a signature for an external command
|
||||
|
||||
- `def_name`: definition name
|
||||
- `params`: parameters
|
||||
|
||||
## Examples
|
||||
|
||||
Write a signature for an external command
|
||||
```shell
|
||||
> extern echo [text: string]
|
||||
```
|
||||
|
@ -27,7 +27,7 @@ Base64 encode a string with default settings
|
||||
|
||||
Base64 encode a string with the binhex character set
|
||||
```shell
|
||||
> echo 'username:password' | hash base64 --character_set binhex --encode
|
||||
> echo 'username:password' | hash base64 --character-set binhex --encode
|
||||
```
|
||||
|
||||
Base64 decode a value
|
||||
|
@ -15,3 +15,10 @@ Runs external command
|
||||
- `...rest`: external command to run
|
||||
- `--redirect-stdout`: redirect-stdout
|
||||
- `--redirect-stderr`: redirect-stderr
|
||||
|
||||
## Examples
|
||||
|
||||
Run an external command
|
||||
```shell
|
||||
> run-external "echo" "-n" "hello"
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user