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."
9 echo " -c camera-id ID of the camera to use (see termux-camera-info), default: 0"
16 while getopts :hc
: option
20 c
) PARAMS
="--es camera $OPTARG";;
21 ?
) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
26 if [ $# = 0 ]; then echo "$SCRIPTNAME: missing file argument"; exit 1; fi
27 if [ $# != 1 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi
30 PARAMS
="$PARAMS --es file `realpath $1`"
32 @TERMUX_API@ CameraPhoto
$PARAMS