curl: Update from 7.48 to 7.49
[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 echo ""
9 exit 0
10}
11
12while getopts :h option
13do
14 case "$option" in
15 h) show_usage;;
16 ?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
17 esac
18done
19shift $(($OPTIND-1))
20
21CMD="@TERMUX_API@ Clipboard -e api_version 2 --ez set true"
22if [ $# = 0 ]; then
23 $CMD
24else
25 echo $@ | $CMD
26fi
27