Use fold to make sure lines don't get too long

This commit is contained in:
Tom Willemse 2014-04-27 02:03:35 +02:00
parent 424a165de5
commit 7f649a3094

27
hypo
View file

@ -19,21 +19,25 @@
URL="https://ryuslash.org/hypo" URL="https://ryuslash.org/hypo"
function fold () { /usr/bin/fold -s -w $(tput cols); }
function help_send function help_send
{ {
echo "Usage: $xname send FILE" echo "Usage: $xname send FILE"
echo " $xname send [SUFFIX]" echo " $xname send [SUFFIX]"
echo echo
echo "Using the first form FILE will be uploaded to a hypo instance and the URL at " echo "Using the first form FILE will be uploaded to a hypo instance \
echo "which it can be visited will be printed." and the URL at which it can be visited will be printed." | fold
echo echo
echo "Using the second form requires that input come from a pipe. Such as:" echo "Using the second form requires that input come from a pipe. \
Such as:" | fold
echo echo
echo " cat somefile.txt | hypo send" echo " cat somefile.txt | hypo send"
echo echo
echo "In this case the argument to send is optional, if it is specified it should " echo "In this case the argument to send is optional, if it is \
echo "include a \`.' to help pygments decide on the syntax highlighting to use. If the " specified it should include a \`.' to help pygments decide on the \
echo "argument is left unspecified it defaults to \`.txt'." syntax highlighting to use. If the argument is left unspecified it \
defaults to \`.txt'." | fold
} }
function cmd_send function cmd_send
@ -59,8 +63,8 @@ function help_scrot
{ {
echo "Usage: $xname scrot ARG" echo "Usage: $xname scrot ARG"
echo echo
echo "The ARG will be passed directly to scrot. The resulting screenshot will be sent" echo "The ARG will be passed directly to scrot. The resulting \
echo "directly to hypo and removed locally." screenshot will be sent directly to hypo and removed locally."
} }
function cmd_scrot function cmd_scrot
@ -72,8 +76,8 @@ function help_rm
{ {
echo "Usage: $xname rm HASH" echo "Usage: $xname rm HASH"
echo echo
echo "Remove a file from hypo. The HASH under which it is stored remotely (the last" echo "Remove a file from hypo. The HASH under which it is stored \
echo "part of the URL) should be specified." remotely (the last part of the URL) should be specified." | fold
} }
function cmd_rm function cmd_rm
@ -102,7 +106,8 @@ function cmd_help
echo " scrot Take a screenshot and send it to a hypo instance" echo " scrot Take a screenshot and send it to a hypo instance"
echo " send Send a file to a hypo instance" echo " send Send a file to a hypo instance"
echo echo
echo "You can use \`$xname help <command>' to get more information about a command." echo "You can use \`$xname help <command>' to get more \
information about a command." | fold
fi fi
} }