update doc with new features
This commit is contained in:
parent
6e64ed64c4
commit
23a8c12bca
1 changed files with 23 additions and 5 deletions
28
README.md
28
README.md
|
|
@ -14,13 +14,13 @@ wget -qO- https://zpkg.zawz.net/install.sh | sh
|
|||
zpkg install lxsh
|
||||
```
|
||||
|
||||
### Binary
|
||||
### Binary amd64
|
||||
|
||||
Download the `lxsh.tar.gz` archive, extract it,
|
||||
Download the `lxsh-linux-amd64.tar.gz` archive, extract it,
|
||||
and move the `lxsh` binary in a PATH folder (`/usr/local/bin` is the recommended).
|
||||
|
||||
```shell
|
||||
wget https://github.com/zawwz/lxsh/releases/download/v1.2.0/lxsh-linux-amd64.tar.gz
|
||||
wget https://github.com/zawwz/lxsh/releases/download/v1.3.0/lxsh-linux-amd64.tar.gz
|
||||
tar -xvf lxsh-linux-amd64.tar.gz
|
||||
sudo mv lxsh /usr/local/bin
|
||||
```
|
||||
|
|
@ -45,6 +45,19 @@ These commands can be placed anywhere within the script like regular commands.
|
|||
|
||||
Reduce code size to a minimum without changing functionality with the `-m` option.
|
||||
|
||||
|
||||
#### Behaviors of the minify option
|
||||
|
||||
- removes any unnecessary separator character between arguments/commands
|
||||
- removes `;;` from the last value in a case
|
||||
- removes unnecessary quotes on arguments
|
||||
- transforms unnecessary manipulations (e.g. `${VAR}`) into simple variable call
|
||||
- Brace blocks or subshells with a single command will be replaced by said command
|
||||
|
||||
> These features only apply if they won't change behavior, for instance
|
||||
removal of an unnecessary manipulation will not be made if the following character
|
||||
could expand the variable name
|
||||
|
||||
### Further minifying
|
||||
|
||||
The script can be further minified by altering code elements.
|
||||
|
|
@ -56,8 +69,6 @@ use `--exclude-var` to exclude variables from being minified (for example enviro
|
|||
Function names can be minified with `--minify-fct`,
|
||||
use `--exclude-fct` to exclude functions from being minified.
|
||||
|
||||
Unnecessary quotes can be removed with `--minify-quotes`.
|
||||
|
||||
Unused functions and variables can be removed with `--remove-unused`.
|
||||
|
||||
Use `-M` to enable all of these minifying features (you still have to specify `--exclude` options when needed)
|
||||
|
|
@ -73,6 +84,9 @@ The following bash features can be debashified:
|
|||
- `[[ ]]` conditions
|
||||
- indexed arrays and associative arrays (+ their `declare` and `typeset` definitions)
|
||||
- `$RANDOM`
|
||||
- substring variable manipulation (`${VAR:N:M}`)
|
||||
- variable substitution (`${!VAR}`)
|
||||
- search replace manipulation (`${VAR/s/a/b}` )
|
||||
|
||||
### Advantages
|
||||
|
||||
|
|
@ -122,6 +136,10 @@ these features will continue working with undesired behavior.
|
|||
|
||||
Array argument with `[@]` does not expand into the desired multiple arguments.
|
||||
|
||||
#### Substring manipulation
|
||||
|
||||
Debashifying a substring manipulation on a variable containing a newline will not work correctly
|
||||
|
||||
## Extension commands
|
||||
|
||||
If you use the `#!/usr/bin/lxsh` shebang, you can use special lxsh-defined commands.
|
||||
|
|
|
|||
Loading…
Reference in a new issue