golang: Update from 1.6.1 to 1.6.2
[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 () {
6 echo "Usage: $SCRIPTNAME <text>"
7 echo "Set the system clipboard text."
8 echo ""
9 echo "If no arguments are given the text to set is read from stdin,"
10 echo "otherwise all arguments given are used as the text to set."
11 exit 0
12}
13
14while getopts :h option
15do
16 case "$option" in
17 h) show_usage;;
18 ?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
19 esac
20done
21shift $(($OPTIND-1))
22
23CMD="@TERMUX_API@ Clipboard -e api_version 2 --ez set true"
9228c434 24if [ $# = 0 ]; then
0ec2b704 25 $CMD
9228c434 26else
0ec2b704 27 echo $@ | $CMD
9228c434
FF
28fi
29