4 SCRIPTNAME
=termux-camera-photo
6 echo "Usage: termux-camera-photo [-c camera-id] output-file"
7 echo "Take a photo and save it to a file in JPEG format."
8 echo " -c camera-id ID of the camera to use (see termux-camera-info), default: 0"
14 while getopts :hc
: option
18 c
) PARAMS
="--es camera $OPTARG";;
19 ?
) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
24 if [ $# = 0 ]; then echo "$SCRIPTNAME: missing file argument"; exit 1; fi
25 if [ $# != 1 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi
28 PARAMS
="$PARAMS --es file `realpath $1`"
30 @TERMUX_API@ CameraPhoto
$PARAMS