implement outputting values of keys not in tables

This commit is contained in:
Emma Tebibyte 2022-11-21 23:10:24 -05:00
parent ecf151ea40
commit 1d06d94058
2 changed files with 26 additions and 18 deletions

10
README.md Normal file
View 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
View File

@ -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