mosquitto: Update from 1.4.10 to 1.4.11
[termux-packages] / packages / termux-api / termux-clipboard-set
... / ...
CommitLineData
1#!/bin/sh
2set -e -u
3
4SCRIPTNAME=termux-clipboard-set
5show_usage () {
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."
8 exit 0
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"
21if [ $# = 0 ]; then
22 $CMD
23else
24 echo $@ | $CMD
25fi
26