diff options
author | Peter Palfrader <peter@palfrader.org> | 2012-04-07 21:58:39 +0000 |
---|---|---|
committer | weasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede> | 2012-04-07 21:58:39 +0000 |
commit | fd3f6f860a1b88d39ec59e0a59cfd53a5f89b7f3 (patch) | |
tree | f09429031548e98454e0a5da6f8570ae8693ee60 | |
parent | 28b9ac5e56171959db78445a92e03e4dea37ccea (diff) |
UTF-8 feature in publish. wow
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@517 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-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 |