From e43ac7778780c10e68cf0254a6cde34b1b5d70ee Mon Sep 17 00:00:00 2001 From: Bo Ørsted Andresen Date: Wed, 28 Feb 2007 12:31:42 +0000 Subject: Now really add --xcut. --- wgetpaste | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wgetpaste b/wgetpaste index 941fde7..72df4c6 100755 --- a/wgetpaste +++ b/wgetpaste @@ -271,6 +271,11 @@ while [[ ! -z "${1}" ]]; do echo "$0, version ${VERSION}" exit 0 ;; + -x | --xcut ) + XCUT=true + SOURCE="xcut" + shift + ;; *) if [[ -f "${1}" ]]; then SOURCE="${1}" @@ -309,7 +314,7 @@ if [[ -z "${DESCRIPTION}" ]]; then fi # handle the case where the input source (defaulting to /dev/stdin) isn't readable verbosely -if [[ ! -r "${SOURCE}" ]]; then +if [[ ! ${XCUT} ]] && [[ ! -r "${SOURCE}" ]]; then echo "The input source: \"${SOURCE}\" is not readable. Please specify a readable input source." 1>&2 echo 1>&2 show_usage 1>&2 @@ -333,7 +338,7 @@ if [[ ${XCUT} ]]; then exit 1 fi else - INPUT="$(escape "$(<${SOURCE})")" + INPUT="$(escape "$( < "${SOURCE}" )")" fi [[ -z "${INPUT}" ]] && die "No input read. Nothing to paste. Aborting." -- cgit v1.2.3