|
@ -4,8 +4,11 @@ |
|
|
if [[ ! -t 0 ]]; then |
|
|
if [[ ! -t 0 ]]; then |
|
|
less -FX |
|
|
less -FX |
|
|
# if there is only one arg and it is not a directory, less it |
|
|
# if there is only one arg and it is not a directory, less it |
|
|
elif [[ -z "$2" && ! -d "$1" ]]; then |
|
|
elif [[ "$#" -eq 1 && ! -d "$1" ]]; then |
|
|
less -FX "$1" |
|
|
less -FX "$1" |
|
|
|
|
|
# if there are exactly two arguments and neither is a directory, diff them |
|
|
|
|
|
elif [[ "$#" -eq 2 && ! -d "$1" && ! -d "$2" ]]; then |
|
|
|
|
|
diff --color=auto -u "$@" |
|
|
# otherwise, run dir |
|
|
# otherwise, run dir |
|
|
else |
|
|
else |
|
|
ls -lhAF --color=auto "$@" |
|
|
ls -lhAF --color=auto "$@" |
|
|