Skip to content

Commit

Permalink
prep for version 2.06
Browse files Browse the repository at this point in the history
  • Loading branch information
wofr06 committed Aug 17, 2022
1 parent 8055dbb commit a218282
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
7 changes: 6 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
****************************************************************************
# ChangeLog for lesspipe.sh #
****************************************************************************
- many changes from shellcheck for better syntax
Version 2.06 Aug 17 2022
- remove perl storable (pst) files interpretation (security fix)
- let bat recognize language, unless explicitly requested
- call the bat colorizer with style=plain
- many changes from ShellCheck for better syntax
- run ShellCheck and test suite in GitHub Actions
- better recognition of hdf and matlab files
Version 2.05 Apr 26 2022
- better colorize handling for bat and file names containing spaces
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# lesspipe.sh, a preprocessor for less

Version: 2.05
Version: 2.06
Author : Wolfgang Friebel [wp.friebel@gmail.com](mailto://wp.friebel@gmail.com)
License: GPL

Expand Down Expand Up @@ -213,7 +213,6 @@ the author by email.
- html,xml requires `w3m` or `lynx` or `elinks` or `html2text`
- pdf requires `pdftotext` or `pdftohtml`
- perl pod requires `pod2text` or `perldoc`
- perl storable requires perl (and the modules Storable and Data::Dumper)
- dvi requires `dvi2tty`
- djvu requires `djvutxt`
- ps requires `ps2ascii` (from the gs package)
Expand Down
10 changes: 4 additions & 6 deletions lesspipe.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# lesspipe.sh, a preprocessor for less (version 2.05)
# lesspipe.sh, a preprocessor for less (version 2.06)
# Author: Wolfgang Friebel (wp.friebel AT gmail.com)
#( [[ -n 1 && -n 2 ]] ) > /dev/null 2>&1 || exec zsh -y --ksh-arrays -- "$0" ${1+"$@"}

Expand Down Expand Up @@ -402,13 +402,11 @@ has_colorizer () {
for i in bat batcat pygmentize source-highlight code2color vimcolor ; do
[[ -z $prog || $prog == "$i" ]] && has_cmd "$i" && prog=$i
done
[[ "$2" =~ ^[0-9]*$ ]] && opt=() || opt=(-l "$2")
ext=${fileext##*.}
[[ "$2" =~ ^[0-9]*$ || -z "$2" ]] && opt=() || opt=(-l "$2")
case $prog in
bat|batcat)
# only allow an explicitly requested language
opt=(-l "$ext")
{ [[ -n $ext ]] && "$prog" "${opt[@]}" /dev/null; } || opt=()
[[ -z $3 ]] && opt=() || opt=(-l "$3")
opt+=("$COLOR" --style=plain --paging=never) ;;
pygmentize)
pygmentize -l "$2" /dev/null &>/dev/null && opt=(-l "$2") || opt=(-g)
Expand Down Expand Up @@ -569,7 +567,7 @@ isfinal () {
[[ -z "$fext" && $fcat == text && $x != plain ]] && fext=$x
[[ -z "$fext" ]] && fext=$(fileext "$fileext")
fext=${fext##*/}
[[ -z ${colorizer[*]} ]] && has_colorizer "$1" "$fext"
[[ -z ${colorizer[*]} ]] && has_colorizer "$1" "$fext" "$file2"
[[ -n ${colorizer[*]} && $fcat != binary ]] && "${colorizer[@]}" "$1" && return
# if fileext set, we need to filter to get rid of .fileext
[[ -n $fileext || "$1" == - || "$1" == "$t" ]] && cat "$1"
Expand Down
4 changes: 1 addition & 3 deletions packaging/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: lesspipe
Version: 2.05-1
Version: 2.06-1
Section: text
Priority: optional
Architecture: all
Expand All @@ -20,5 +20,3 @@ Description: lesspipe.sh is an input filter for the pager less.
easily extensible for new formats. The input filter is a bash script, but
works as well as a zsh script. For zsh and bash a completion mechanism for
archive contents is provided.


6 changes: 4 additions & 2 deletions packaging/lesspipe.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%define packagename lesspipe
%define packageversion 2.05
%define packageversion 2.06
%define packagerelease 1

Name: %{packagename}
Expand Down Expand Up @@ -89,7 +89,9 @@ cd $RPM_BUILD_DIR
%docdir %{prefix}/share/man/man1

%changelog
* Tue Apr 26 2022 2.05-1 20220228 - wp.friebel@gmail.com
* Wed Aug 17 2022 2.06-1 20220817 - wp.friebel@gmail.com
- remove perl storable files handling, changes recommended by Shellcheck
* Tue Apr 26 2022 2.05-1 20220426 - wp.friebel@gmail.com
- fix colorizing using bat and for file names containing spaces
* Mon Feb 28 2022 2.04-1 20220228 - wp.friebel@gmail.com
- handle csv files, lessfilter can be in path
Expand Down

0 comments on commit a218282

Please sign in to comment.