From 1472fdf14a3636c3ffb041602711ed2d1bdf217b Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 6 Jun 2014 23:09:05 -0400 Subject: [PATCH] Improve response when pex is called without any arguments --- pex | 4 ++++ t/misc.t | 10 ++++++++++ 2 files changed, 14 insertions(+) create mode 100644 t/misc.t diff --git a/pex b/pex index 194c4ce..ee73ba2 100755 --- a/pex +++ b/pex @@ -910,6 +910,10 @@ psql() { } +if [ $# -eq 0 ]; then + error "usage: pex COMMAND [PACKAGE] (try \" --help\")" +fi + case $1 in --help|-\?) echo "$usage"; exit 0;; diff --git a/t/misc.t b/t/misc.t new file mode 100644 index 0000000..1ddbfd5 --- /dev/null +++ b/t/misc.t @@ -0,0 +1,10 @@ +#!/bin/sh + +. ./t/libtap.sh +. ./t/fixtures.sh + +plan 1 + +ok_program 'pex without arguments' 1 'pex: usage: pex COMMAND [PACKAGE] (try " --help")' pex + +cleanup