implement outputting values of keys not in tables
This commit is contained in:
parent
ecf151ea40
commit
1d06d94058
10
README.md
Normal file
10
README.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
`tomcat` – a [TOML](https://toml.io) parser in POSIX shell
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
### From Source
|
||||||
|
|
||||||
|
Clone this repository and move the `tomcat` binary wherever your operating
|
||||||
|
system stores locally-installed binaries. This is usually `/usr/local/bin` or
|
||||||
|
`$HOME/.local/bin` for your user. Make sure the installation location is in your
|
||||||
|
`$PATH`.
|
||||||
34
tomcat
34
tomcat
@ -2,18 +2,13 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
ARG="$(printf "%s\n" "$1" | sed -n '/-/p')"
|
argv1="$1"
|
||||||
|
argv2="$2"
|
||||||
|
|
||||||
# check usage
|
# check usage
|
||||||
if ! test -n "$1"; then
|
if ! test -n "$1"; then
|
||||||
printf "Usage: %s [OPTIONS] [TABLE.KEY[INDEX]] [FILE]\n" "$0" 1>&2
|
printf "Usage: %s [OPTIONS] [TABLE.KEY[INDEX]] [FILE]\n" "$0" 1>&2
|
||||||
exit 64 # sysexits(3) EX_USAGE
|
exit 64 # sysexits(3) EX_USAGE
|
||||||
elif test -n "$ARG"; then
|
|
||||||
argv1="$2"
|
|
||||||
argv2="$3"
|
|
||||||
else
|
|
||||||
argv1="$1"
|
|
||||||
argv2="$2"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# test if input has a period
|
# test if input has a period
|
||||||