curl: Update from 7.48 to 7.49
[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."
8 echo ""
9 exit 0
0ec2b704
FF
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"
9228c434 22if [ $# = 0 ]; then
0ec2b704 23 $CMD
9228c434 24else
0ec2b704 25 echo $@ | $CMD
9228c434
FF
26fi
27