|| "$archive_file" =~ .*\.iar$ \
|| "$archive_file" =~ .*\.oar$ \
|| "$archive_file" =~ .*\.tgz$ \
+ || "$archive_file" =~ .*\.txz$ \
|| "$archive_file" =~ .*\.ova$ \
|| "$archive_file" =~ .*\.snarf$ \
]]; then
define_yeti_alias less='lesser'
define_yeti_alias mo='lesser'
define_yeti_alias more='lesser'
-define_yeti_alias lesser='/bin/less -r'
+define_yeti_alias lesser='bash $FEISTY_MEOW_SCRIPTS/files/lesser.sh'
##############
# set this so nechung can find its data.
define_yeti_variable NECHUNG=$FEISTY_MEOW_APEX/infobase/fortunes.dat
- # establish a pipe for less to see our beloved syntax highlighting.
- define_yeti_variable LESSOPEN="| source-highlight -f esc -o STDOUT -i %s"
+## # establish a pipe for less to see our beloved syntax highlighting.
+## define_yeti_variable LESSOPEN="| source-highlight -f esc -o STDOUT -i %s"
# ensure we use the right kind of secure shell.
# define_yeti_variable CVS_RSH=$FEISTY_MEOW_SCRIPTS/security/ssh.sh
--- /dev/null
+#!/bin/bash
+
+# runs the less command but with some additional options.
+#
+# we always pass the raw flag (-r) so our special formatting is not lost.
+# this may not be the best choice for some text terminals.
+#
+# there is also a "code" option added (-c) that formats the incoming data as
+# if it were source code before showing the output. this works great on files
+# that are actually recognized as source code, and not so great on other
+# things like simple lists or error output.
+function lesser()
+{
+ code_view_flag="$1"
+ if [ "$code_view_flag" == "-c" ]; then
+ # saw the 'code' flag, which means show the file with source highlighting.
+ shift
+#echo saw the code flag
+
+ else
+ # drop the value and emptiness will mean don't show code.
+ unset code_view_flag
+ fi
+
+ if [ ! -z "$code_view_flag" ]; then
+ # establish a pipe for less to see our beloved syntax highlighting.
+ export LESSOPEN="| source-highlight -f esc -o STDOUT -i %s"
+ fi
+
+#hmmm, will we need to iterate on the input array to get this right?
+
+ # run the source highlighter first if needed.
+ /bin/less -r "${@}"
+
+#hmmm: do we need to protect above from space hosings?
+#hmmm: done, maybe. if this still works for multiple parms...
+
+}
+
+