diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-10-25 00:47:47 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-10-25 00:47:47 +0200 |
| commit | c6cc0108ca7738023b45e0eeac0fa2390532dd93 (patch) | |
| tree | 36890e6cd3091bbab8efbe686cc56f467f645bfd /vendor/github.com/alecthomas/chroma/v2/lexers/bashsession.go | |
| parent | 0130404a1dc663d4aa68d780c9bcb23a4243e68d (diff) | |
| download | jbmafp-c6cc0108ca7738023b45e0eeac0fa2390532dd93.tar.gz | |
Diffstat (limited to 'vendor/github.com/alecthomas/chroma/v2/lexers/bashsession.go')
| -rw-r--r-- | vendor/github.com/alecthomas/chroma/v2/lexers/bashsession.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/vendor/github.com/alecthomas/chroma/v2/lexers/bashsession.go b/vendor/github.com/alecthomas/chroma/v2/lexers/bashsession.go new file mode 100644 index 0000000..bea9393 --- /dev/null +++ b/vendor/github.com/alecthomas/chroma/v2/lexers/bashsession.go @@ -0,0 +1,26 @@ +package lexers + +import ( + . "github.com/alecthomas/chroma/v2" // nolint +) + +// BashSession lexer. +var BashSession = Register(MustNewLexer( + &Config{ + Name: "BashSession", + Aliases: []string{"bash-session", "console", "shell-session"}, + Filenames: []string{".sh-session"}, + MimeTypes: []string{"text/x-sh"}, + EnsureNL: true, + }, + bashsessionRules, +)) + +func bashsessionRules() Rules { + return Rules{ + "root": { + {`^((?:\[[^]]+@[^]]+\]\s?)?[#$%>])(\s*)(.*\n?)`, ByGroups(GenericPrompt, Text, Using("Bash")), nil}, + {`^.+\n?`, GenericOutput, nil}, + }, + } +} |
