Skip to content

Commit

Permalink
changes for csv files and using the column program
Browse files Browse the repository at this point in the history
  • Loading branch information
wofr06 committed Nov 26, 2023
1 parent 33c2f19 commit d1acbf7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
****************************************************************************
# ChangeLog for lesspipe.sh #
****************************************************************************
- column does not accept std input
- fix html output with html2text
- correct location of bash completion directory
- respect csv file extension
Version 2.10 Oct 05 2023
- column does not accept -o option (BSD systems)
- respect jsx and tsx file extension
Version 2.09 Oct 03 2023
- preferred display of csv files is through the program column
- language recognition for bat improved
Expand Down
6 changes: 4 additions & 2 deletions lesspipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ filetype () {
mp3)
[[ $ftype == mpeg ]] && ftype=mp3 ;;
jsx)
[[ $fcat == text ]] && ftype=$fext ;;
[[ $fcat == text ]] && ftype=jsx ;;
tsx)
[[ $fcat == text ]] && ftype=typescript-jsx ;;
csv)
[[ $fcat == text ]] && ftype=csv ;;
esac
### get file type from 'file' command for an unspecific result
if [[ "$fcat" == message && $ftype == plain ]]; then
Expand Down Expand Up @@ -583,7 +585,7 @@ isfinal () {
has_cmd ccze && [[ $COLOR = *always ]] && ccze -A < "$1"
return ;;
csv)
{ has_cmd column && cmd=(column -s " ,;" -t "$1"); } ||
{ has_cmd column && cmd=(istemp "column -s ,; -t" "$1"); } ||
{ has_cmd pandoc && cmd=(pandoc -f csv -t plain "$1"); } ;;
json)
[[ $COLOR = *always ]] && opt=(-C .) || opt=(.)
Expand Down

0 comments on commit d1acbf7

Please sign in to comment.