diff options
Diffstat (limited to 'publish')
-rwxr-xr-x | publish | 26 |
1 files changed, 19 insertions, 7 deletions
@@ -67,12 +67,13 @@ usage: $0 [<src> [<src> ...]] copy the file <src> to a server an report the URL. OPTIONS: - -n no-do. Just print what would have been done - -H Show the history + -n no-do. Just print what would have been done. + -H Show the history. -S Make a screenshot of one window and publish. - -x Publish the contents of the xclipboard - -h Show this message - -q Produce a QR code + -x Publish the contents of the xclipboard. + -h Show this message. + -q Produce a QR code. + -8 Add a AddDefaultCharset UTF-8 .htaccess file. EOF } @@ -109,8 +110,9 @@ NODO="" inputxclip=0 do_screenshot=0 make_qrcode=0 +add_default_cs=0 -while getopts "hnqHSxs:" OPTION +while getopts "hnq8HSxs:" OPTION do case $OPTION in h) @@ -126,6 +128,9 @@ do x) inputxclip=1 ;; + 8) + add_default_cs=1 + ;; H) if [ -r "$history_file" ]; then history_show @@ -218,14 +223,21 @@ if [ "$make_qrcode" -gt 0 ] ; then setup_tmpdir img="$tmpdir/.qr.png" echo -n "$main_uri" | qrencode -s 5 -l H -o "$img" - $NODO rsync $rsync_args "$img" $base_rsync"/$d_server/" echo "$base_uri"".qr.png" main_uri="$base_uri"".qr.png" + set dummy "$img" "$@" + shift else echo >&2 "Warning: qrencode not found." fi fi +if [ "$add_default_cs" -gt 0 ] ; then + echo 'AddDefaultCharset UTF-8' > "$tmpdir/.htaccess" + set dummy "$tmpdir/.htaccess" "$@" + shift +fi + if command -v xclip >/dev/null 2>&1; then echo -n "$main_uri" | xclip fi |