mirror of
https://git.zx2c4.com/cgit
synced 2024-11-26 02:18:42 +00:00
syntax-highlight: when the file has no extension, assume text
There are 2 situations: 1- empty extension: assuming text is better than highlight producing no output because of a missing argument. 2- no extension at all: assuming text is better than setting the extension to the filename, which is what now happens. Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
This commit is contained in:
parent
e52a5226b8
commit
d14faf4424
@ -39,8 +39,11 @@
|
|||||||
BASENAME="$1"
|
BASENAME="$1"
|
||||||
EXTENSION="${BASENAME##*.}"
|
EXTENSION="${BASENAME##*.}"
|
||||||
|
|
||||||
|
[ "${BASENAME}" = "${EXTENSION}" ] && EXTENSION=txt
|
||||||
|
[ -z "${EXTENSION}" ] && EXTENSION=txt
|
||||||
|
|
||||||
# map Makefile and Makefile.* to .mk
|
# map Makefile and Makefile.* to .mk
|
||||||
[ "${BASENAME%%.*}" == "Makefile" ] && EXTENSION=mk
|
[ "${BASENAME%%.*}" = "Makefile" ] && EXTENSION=mk
|
||||||
|
|
||||||
# highlight versions 2 and 3 have different commandline options. Specifically,
|
# highlight versions 2 and 3 have different commandline options. Specifically,
|
||||||
# the -X option that is used for version 2 is replaced by the -O xhtml option
|
# the -X option that is used for version 2 is replaced by the -O xhtml option
|
||||||
|
Loading…
Reference in New Issue
Block a user