dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 1899158a27d82e081f69d1beaead28449f82acdb
parent 402f5c64c78ba165a2c3bff41912076bfaa0e10d
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Thu, 25 Jul 2019 16:30:52 +0200

Use tabs for indentation

Diffstat:
M.local/bin/bookmark | 129+++++++++++++++++++++++++++++++++++++++----------------------------------------
1 file changed, 64 insertions(+), 65 deletions(-)

diff --git a/.local/bin/bookmark b/.local/bin/bookmark @@ -8,100 +8,99 @@ remotefile="/home/$remoteuser/doc/bookmark.txt" port=12346 help() { - echo "Usage: ${0##*/} [OPTION | COMMAND [URL]]" + echo "Usage: ${0##*/} [OPTION | COMMAND [URL]]" } init() { - mkdir -p "$(dirname "$localfile")" - touch "$localfile" - ssh -p "$port" -q "$remoteuser@$hostname" -t \ - "mkdir -p $(dirname $remotefile) && touch $remotefile" + mkdir -p "$(dirname "$localfile")" + touch "$localfile" + ssh -p "$port" -q "$remoteuser@$hostname" -t \ + "mkdir -p $(dirname $remotefile) && touch $remotefile" } upload() { - scp -q \ - -P "$port" \ - "$localfile" \ - "$remoteuser@$hostname:$remotefile" + scp -q \ + -P "$port" \ + "$localfile" \ + "$remoteuser@$hostname:$remotefile" } download() { - scp -q \ - -P "$port" \ - "$remoteuser@$hostname:$remotefile" \ - "$localfile" + scp -q \ + -P "$port" \ + "$remoteuser@$hostname:$remotefile" \ + "$localfile" } clear() { - while :; do - printf "%s" "Really delete all bookmarks? [y/N] " - read -r yn - case $yn in - [Yy]*) - rm "$localfile" - ssh -q "$remoteuser@$hostname" -t "rm $remotefile"; - break;; - *) - exit 1;; - esac - done + while :; do + printf "%s" "Really delete all bookmarks? [y/N] " + read -r yn + case $yn in + [Yy]*) + rm "$localfile" + ssh -q "$remoteuser@$hostname" -t "rm $remotefile"; + break;; + *) + exit 1;; + esac + done } edit() { - "$EDITOR" "$localfile" + "$EDITOR" "$localfile" } printall() { - cat "$localfile" + cat "$localfile" } exporthtml() { - echo "<!DOCTYPE html>" - echo "<html><head>" - echo "<title>Bookmarks</title>" - echo "<meta charset='utf-8'>" - echo "</head><body>" + echo "<!DOCTYPE html>" + echo "<html><head>" + echo "<title>Bookmarks</title>" + echo "<meta charset='utf-8'>" + echo "</head><body>" - printall | \ - sed 's/ /">/' | \ - sed 's/^/<a href="/' | \ - sed 's/$/<\/a><\/br>/' - - echo "</body></html>" + printall | \ + sed 's/ /">/' | \ + sed 's/^/<a href="/' | \ + sed 's/$/<\/a><\/br>/' + echo "</body></html>" } add() { - echo "$@" >> "$localfile" + echo "$@" >> "$localfile" } [ $# -eq 0 ] && help && exit 0 case "$1" in - -h | --help) - help - ;; - init) - init - ;; - edit) - download - edit - upload - ;; - list) - download - printall - ;; - clear) - clear - init - ;; - exporthtml) - exporthtml - ;; - *) - download - add "$@" - upload + -h | --help) + help + ;; + init) + init + ;; + edit) + download + edit + upload + ;; + list) + download + printall + ;; + clear) + clear + init + ;; + exporthtml) + exporthtml + ;; + *) + download + add "$@" + upload esac exit 0