Skip to content

Commit

Permalink
Doc fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fare committed Oct 28, 2023
1 parent 12acdd5 commit f13ffee
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions doc/reference/std/cli/shell.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
The `:std/cli/shell` library provides facilities for working with Unix shell code

::: tip usage
```scheme
(import :std/cli/shell)
```
:::

An earlier version of this library used to be available as `:clan/shell`
Expand All @@ -25,7 +27,7 @@ All other ASCII characters may require the string to be quoted.
For good measure we also quote strings containing non-ASCII characters.

::: tip Examples:
``` scheme
```scheme
> (string-for-each (lambda (c) (or (easy-shell-character? c) (error "foo")))
"abcdefghijklmnopqrstuvwxzABCDEFGHIJKLMNOPQRSTUVWXZ012345678@%-_=+:,./") ;; no error
> (string-for-each (lambda (c) (or (not (easy-shell-character? c)) (error "foo")))
Expand All @@ -43,7 +45,7 @@ The current implementation only trusts strings where every character
satisfies `easy-shell-character?` to not require quoting.

::: tip Examples:
``` scheme
```scheme
> (map needs-shell-escape ["foo?" "~user" "$1" "*.*" "!1" "ab\\cd" "{}" "a;b" "&" "|" "a b c"])
(#t #t #t #t #t #t #t #t #t #t #t)
> (map needs-shell-escape ["foo" "%-_=+:,./" "1" "..." "abcd" "x=y:z,t.z/u+v_w"])
Expand All @@ -59,7 +61,7 @@ Given a `string`, returns a shell-escaped-string that,
when included in a Unix shell command, will expand into the input `string`.

::: tip Examples:
``` scheme
```scheme
> (map escape-shell-token ["foo?" "~user" "$1" "*.*" "!1" "ab\\cd" "{}" "a;b" "&" "|" "a b c"])
("\"foo?\"" "\"~user\"" "\"\\$1\"" "\"*.*\"" "\"!1\"" "\"ab\\\\cd\"" "\"{}\"" "\"a;b\"" "\"&\"" "\"|\"" "\"a b c\"")
> (let (l ["foo" "%-_=+:,./" "1" "..." "abcd" "x=y:z,t.z/u+v_w"])
Expand All @@ -68,7 +70,7 @@ when included in a Unix shell command, will expand into the input `string`.
```
:::

### ->envvar
### ->envvar
```scheme
(->envvar . str) => environment-variable-name
```
Expand Down

0 comments on commit f13ffee

Please sign in to comment.