diff options
author | Bo Ørsted Andresen <bo.andresen@zlin.dk> | 2007-02-28 12:31:42 +0000 |
---|---|---|
committer | Bo Ørsted Andresen <bo.andresen@zlin.dk> | 2007-02-28 12:31:42 +0000 |
commit | e43ac7778780c10e68cf0254a6cde34b1b5d70ee (patch) | |
tree | 953030cf514164eeab8a148742e7a2c8343ac15e | |
parent | 52f3ffaff5437a2f8a3786ededb43a3fee7fdcca (diff) | |
download | wgetpaste-e43ac7778780c10e68cf0254a6cde34b1b5d70ee.tar.gz |
Now really add --xcut.
-rwxr-xr-x | wgetpaste | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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." |