Commit bffc372b authored by ngirard's avatar ngirard Committed by Michael Aaron Murphy
Browse files

docs(manual): Fix various issues in the manual

parent 7d37dbc4
......@@ -46,6 +46,8 @@ redox:
- redoxer test
pages:
before_script:
- (test -x $HOME/.cargo/bin/mdbook-linkcheck || cargo install mdbook-linkcheck)
image: hrektts/mdbook
stage: deploy
script:
......
......@@ -35,7 +35,7 @@ See the [examples folder](https://gitlab.redox-os.org/redox-os/ion/tree/master/e
## Pop!\_OS / Ubuntu
The following PPA supports the 18.04 (bionic) and 18.10 (cosmic) releases. Bionic builds were made using the Pop\_OS PPA's rustc 1.35.0 package.
The following PPA supports the 18.04 (bionic) and 19.04 (disco) releases. Bionic builds were made using the Pop\_OS PPA's rustc 1.35.0 package.
```
sudo add-apt-repository ppa:mmstick76/ion-shell
......
[book]
title = "Ion Documentation"
description = "A modern system shell that features a simple, yet powerful, syntax. Written entirely in Rust."
authors = ["Michael Murphy", "Xavier L'Heureux", "Jeremy Soller"]
language = "en"
[build]
create-missing = false
[output.html]
git-repository-url = "https://gitlab.redox-os.org/redox-os/ion"
git-repository-icon = "fa-github"
[output.linkcheck]
# Should we check links on the internet? Enabling this option adds a
# non-negligible performance impact
follow-web-links = false
# Are we allowed to link to files outside of the book's root directory? This
# may help prevent linking to sensitive files (e.g. "../../../../etc/shadow")
traverse-parent-directories = false
......@@ -2,7 +2,7 @@
- [Introduction](introduction.md)
- [Migrating from POSIX shells](migration.md)
- [Migrating from POSIX shells](migrating.md)
- [Miscellaneous](misc/index.md)
......
......@@ -72,17 +72,17 @@ DESCRIPTION
```txt
SYNOPSIS
starts_with <PATTERN> tests...
contains <PATTERN> tests...
DESCRIPTION
Returns 0 if any argument starts_with contains the first argument, else returns 0
Returns 0 if any given argument contains the first argument, else returns 1
```
## dir_depth - set the dir stack depth
## dir-depth - set the dir stack depth
```txt
SYNOPSYS
dir_depth [DEPTH]
dir-depth [DEPTH]
DESCRIPTION
If DEPTH is given, set the dir stack max depth to DEPTH, else remove the limit
......@@ -155,14 +155,14 @@ OPTIONS
\v vertical tab (VT)
```
## ends_with - check if a given string starts with another one
## ends-with - check if a given string starts with another one
```txt
SYNOPSIS
starts_with <PATTERN> tests...
ends-with <PATTERN> tests...
DESCRIPTION
Returns 0 if any argument starts_with contains the first argument, else returns 0
Returns 0 if any argument ends with the first argument, else returns 1
```
## eval - evaluates the specified commands
......@@ -305,7 +305,7 @@ SYNOPSIS
is [ -h | --help ] [not]
DESCRIPTION
Returns 0 if the two arguments are equal
Returns 0 if the two arguments are equal, and 1 otherwise.
OPTIONS
not
......@@ -319,7 +319,7 @@ SYNOPSIS
isatty [FD]
DESCRIPTION
Returns 0 exit status if the supplied file descriptor is a tty.
Returns 0 if the supplied file descriptor is a tty, and 1 otherwise.
```
## jobs - list all jobs running in the background
......@@ -428,14 +428,14 @@ DESCRIPTION
variables will affect the current shell because of this.
```
## starts_with - check if a given string starts with another one
## starts-with - check if a given string starts with another one
```txt
SYNOPSIS
starts_with <PATTERN> tests...
starts-with <PATTERN> tests...
DESCRIPTION
Returns 0 if any argument starts_with contains the first argument, else returns 0
Returns 0 if any given argument starts with the first argument, else returns 1
```
## status - Evaluates the current runtime status
......
......@@ -17,11 +17,11 @@ that `1` should indicate success, and `0` should indicate a general error, so th
found in POSIX shells will be preserved.
We supply a number of builtin commands that are utilized for the purpose of evaluating
expressions and values that we create within our shell. One of these commands is the `test`
builtin, which is commonly found in other POSIX shells, and whose flags and operation should
be identical. **TODO: Insert Manual Page Link To Our Implementation** We also supply a `not`
builtin, which may be convenient to use in conjuction with other commands in order to flip
the exit status; and a `matches` builtin that performs a regex-based boolean match.
expressions and values that we create within our shell. One of these commands is the [`test`
builtin](../builtins.md#test---perform-tests-on-files-and-text), which is commonly found
in other POSIX shells, and whose flags and operation should be identical.
We also supply a `not` builtin, which may be convenient to use in conjuction with other commands
in order to flip the exit status; and a `matches` builtin that performs a regex-based boolean match.
```sh
if test "foo" = $foo
......
......@@ -54,7 +54,7 @@ As another example:
```
fn hello name age:int hobbies:[str]
echo $name ($age) has the following hobbies:
echo "$name ($age) has the following hobbies:"
for hobby in @hobbies
echo " $hobby"
end
......@@ -71,7 +71,7 @@ As with any other statement, you can pipe functions using `read`.
```sh
fn format_with pat
read input
echo $join(@split(input), $pat)
echo $join(@split($input) $pat)
end
echo one two three four five | format_with "-"
......
......@@ -7,7 +7,7 @@ Redirection will write the output of a command to a file.
### Redirect Stdout
```sh
command > stderr
command > stdout
```
### Redirect Stderr
......
......@@ -52,7 +52,7 @@ let other_array = [ this is the ion ]
let array = [ @array @other_array shell ]
let as_string = @array
echo @array
echo $array
echo $as_string
```
```
......
......@@ -18,7 +18,7 @@ let hashmap:hmap[str] = [ foo=hello bar=world fizz=I buzz=was bazz=here ]
let btreemap:bmap[str] = [ foo=hello bar=world fizz=I buzz=was bazz=here ]
```
## Fetch a variables by key
## Fetch a variable by key
```
let x = bazz
......
......@@ -751,7 +751,7 @@ pub fn help(args: &[types::Str], shell: &mut Shell<'_>) -> Status {
println!("Command helper not found [run 'help']...");
}
} else {
println!("{}", shell.builtins().keys().format("\n"));
println!("{}", shell.builtins().keys().sorted().format("\n"));
}
Status::SUCCESS
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment