6 echo "usage: termux-camera-photo [OPTIONS] <output-file>"
8 echo "Take a photo and save it in a file. Valid options:"
9 echo " -c, --camera <camera-id> the ID of the camera to use"
10 echo "Use termux-camera-info for information about available camera IDs."
14 O=`getopt -l camera: -l help -l size -- c:hs: "$@"`
18 -c|--camera) PARAMS="$PARAMS --es camera $2"; shift 2;;
19 -h|--help) show_usage; exit 0;;
20 -s|--size) PARAMS="$PARAMS --ei size_index $2"; shift 2;;
22 *) echo Error; exit 1;;
26 if [ $# != 1 ]; then show_usage; exit 1; fi
29 PARAMS="$PARAMS --es file `realpath $1`"
31 termux-api CameraPhoto $PARAMS