You are not logged in.
Pages: 1
Just put up a PKGBUILD for docopts. It's the CLI interface to docopt.
Here's a script to show how it's useful:
#!/bin/sh
usage="calc - Simplified bc wrapper
Usage:
calc [options] <expression>
calc -h | --help
Description:
Tired of having to type some long line just to get the answer to
get to important questions like '2 + 2'? Me, too!
Options:
-s <number> --scale=<number> Set decimal precision (default 2)
-h --help Print this help message"
eval "$(docopts "$usage" "$version" "--" "$@")"
if [ ! $scale ]
then
scale=2
fi
echo "scale=$scale;" "$expression" | bc
Is that not most amazing thing you've ever seen? Computers are glorious.
Offline
Pages: 1