4 echo "usage: termux-share [options] [file]"
5 echo "Share a file specified as argument or the stdin as text input."
7 echo " -a, --action which action to performed on the shared content: edit/send/view (default:view)"
8 echo " -d, --default share to the default receiver if one is selected (instead of showing a chooser)"
9 echo " -t, --title title to use for shared content (default: shared file name)"
10 echo " -c, --content-type content-type to use (default: guessed from file extension, text/plain for stdin)"
23 echo "Unsupported action: '$SHARETYPE' - only edit/send/view available"
30 O=`busybox getopt -q -l action: -l content-type: -l default -l help -l mimetype -l title: -- a:c:dht: "$@"`
31 if [ $? != 0 ] ; then show_usage; exit 1 ; fi
35 -a|--action) validate_share $2; PARAMS="$PARAMS --es action $2"; shift 2;;
36 -c|--content-type) PARAMS="$PARAMS --es content-type $2"; shift 2;;
37 -d|--default) PARAMS="$PARAMS --ez default-receiver true"; shift 1;;
38 -h|--help) show_usage; exit 0;;
39 -t|--title) PARAMS="$PARAMS --es title $2"; shift 2;;
41 *) echo Error; exit 1;;
45 if [ $# -gt 1 ]; then echo "Only one file can be shared"; exit 1; fi
46 if [ $# != 0 ]; then PARAMS="$PARAMS --es file `realpath $1`"; fi
48 @TERMUX_API@ Share $PARAMS