termux-api: Remove empty lines from -h output
[termux-packages] / packages / termux-api / termux-clipboard-set
CommitLineData
cc1ae02e 1#!/bin/sh
0ec2b704 2set -e -u
59f0d218 3
0ec2b704
FF
4SCRIPTNAME=termux-clipboard-set
5show_usage () {
bea93fbd
FF
6 echo "Usage: $SCRIPTNAME [text]"
7 echo "Set the system clipboard text. The text to set is either supplied as arguments or read from stdin if no arguments are given."
bea93fbd 8 exit 0
0ec2b704
FF
9}
10
11while getopts :h option
12do
13 case "$option" in
14 h) show_usage;;
15 ?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
16 esac
17done
18shift $(($OPTIND-1))
19
20CMD="@TERMUX_API@ Clipboard -e api_version 2 --ez set true"
9228c434 21if [ $# = 0 ]; then
0ec2b704 22 $CMD
9228c434 23else
0ec2b704 24 echo $@ | $CMD
9228c434
FF
25fi
26