summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-02-10 20:34:20 -0500
committerJune McEnroe <june@causal.agency>2019-02-10 20:34:20 -0500
commit8110bc3af5c547b91cdd863c575b5a9c13f62b8e (patch)
treebcfa34b9b90aa6af57ee0d1180eb499c81a7ec13 /bin
parentDon't match DQ string inside SQ string (diff)
downloadsrc-8110bc3af5c547b91cdd863c575b5a9c13f62b8e.tar.gz
src-8110bc3af5c547b91cdd863c575b5a9c13f62b8e.zip
Add plain text "language" to hi
Diffstat (limited to 'bin')
-rw-r--r--bin/hi.c3
-rw-r--r--bin/man1/hi.13
2 files changed, 5 insertions, 1 deletions
diff --git a/bin/hi.c b/bin/hi.c
index 50b9b064..8a254ce9 100644
--- a/bin/hi.c
+++ b/bin/hi.c
@@ -213,6 +213,7 @@ static const struct Language {
 	{ "make", "[.]mk$|^Makefile$", MakeSyntax, ARRAY_LEN(MakeSyntax) },
 	{ "mdoc", "[.][1-9]$", MdocSyntax, ARRAY_LEN(MdocSyntax) },
 	{ "sh",   "[.]sh$", ShSyntax, ARRAY_LEN(ShSyntax) },
+	{ "text", "[.]txt$", NULL, 0 },
 };
 
 static regex_t compile(const char *pattern, int flags) {
@@ -634,7 +635,7 @@ int main(int argc, char *argv[]) {
 		name = strrchr(path, '/');
 		name = (name ? &name[1] : path);
 	}
-	if (!lang.syntax && !matchLanguage(&lang, name)) {
+	if (!lang.name && !matchLanguage(&lang, name)) {
 		errx(EX_USAGE, "cannot infer language for %s", name);
 	}
 	if (!opts[Title]) opts[Title] = name;
diff --git a/bin/man1/hi.1 b/bin/man1/hi.1
index 046b6384..48df1606 100644
--- a/bin/man1/hi.1
+++ b/bin/man1/hi.1
@@ -142,4 +142,7 @@ only with a delimiter of
 .Ql EOF .
 Arbitrarily nested strings and command substitutions
 are not highlighted correctly.
+.
+.It Cm text
+Plain text.
 .El