# ltsh
small utility to perform a type-check on shell-pipelines
### Example
```sh
[~]$ ltsh <<< 'echo -n $PATH | xargs stat -c %x | sort -n'
```
```
--- BEGIN TYPE-ANALYSIS ---
* unknown stdin-type for `echo -n $PATH`
* !====> TYPE MISMATCH !! <====!
——————————
....`echo -n $PATH` outputs
>~~>~~
———————————
.... `xargs stat -c %x` expects
>~~>~~
——————————
* !====> TYPE MISMATCH !! <====!
——————————
....`xargs stat -c %x` outputs
>~~
———————————
.... `sort -n` expects
~~~Char>>~~
——————————
--- END TYPE-ANALYSIS ---
```
### Use as Zsh-extension
To automatically check every pipeline entered during interactive shell
use, add the following hook to your `.zshrc`:
```sh
preexec() {
ltsh <<< "$1"
}
```
## Limitations
* only parses pipelines
* ignores quoting rules & expansions
* regex-based typedb implementation (slow & incapable)
### License
[GPLv3](COPYING)