From b2d0d574684365ef88c38e8f77f49c61c82a70be Mon Sep 17 00:00:00 2001 From: tg Date: Tue, 17 Apr 2007 20:04:08 +0000 Subject: [PATCH] change our coding style for shell: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit we already do not 'function\nfoo\n{' for shell, like style(9) requires for C programming, but 'function foo\n{' instead. however, we could treat the function keyword as indentation initialiser and use 'function foo {' (on a line for itself) – it looks different, unusual, but acceptable, and mksh's own output (dumping with the “functions” builtin) does that too (although, its indentation style sucks, but is legible enough) --- dot.mkshrc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dot.mkshrc b/dot.mkshrc index f5c0b7e..510ccff 100644 --- a/dot.mkshrc +++ b/dot.mkshrc @@ -27,16 +27,14 @@ alias la='l -a' alias ll='l -l' alias lo='la -lo' whence -p rot13 >/dev/null || alias rot13='tr [A-Za-z] [N-ZA-Mn-za-m]' -whence -p hd >/dev/null || function hd -{ +whence -p hd >/dev/null || function hd { hexdump -e '"%08.8_ax " 8/1 "%02X " " - " 8/1 "%02X "' \ -e '" |" "%_p"' -e '"|\n"' "$@" } # strip comments (and leading/trailing whitespace if IFS is set) from # any file(s) given as argument, or stdin if none, and spew to stdout -function Lstripcom -{ +function Lstripcom { cat "$@" | { set -o noglob; while read _line; do _line=${_line%%#*} [[ -n $_line ]] && print -r -- $_line @@ -45,4 +43,4 @@ function Lstripcom # place customisations between this line and the ": RCSID" line below -: $MirOS: src/bin/mksh/dot.mkshrc,v 1.10 2007/04/17 20:00:37 tg Exp $ +: $MirOS: src/bin/mksh/dot.mkshrc,v 1.11 2007/04/17 20:04:08 tg Exp $