]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - lessfilter
shell/aliases: fix typo in comment
[config/dotfiles.git] / lessfilter
index fc9eac4e13a760bfdc94238c6130fea446b48148..1403df463f98fa8cdf64cf106ab1bd6290f122a8 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright (C) 2011-2013  Simon Ruderich
+# Copyright (C) 2011-2014  Simon Ruderich
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
+set -eu
+
 case "$1" in
     # Color diff files.
     *.diff | *.patch)
-        < "$1" colordiff
+        colordiff <"$1"
+        ;;
+
+    *.nfo)
+        iconv -f latin1 -t utf-8 <"$1"
         ;;
+
     *)
         # Display directory contents.
         if test -d "$1"; then
-            echo "=> Contents of $1:"
-            ls "$1"
+            printf '=> Contents of %s:\n' "$1"
+            ls -- "$1"
             exit 0
         fi