From 89d212b71cbee12085fa656cfc4468fd9602ff0b Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Fri, 9 Aug 2024 16:53:24 -0300 Subject: [PATCH] Start actual CLI --- src/main.cr | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/main.cr b/src/main.cr index 5243dad..c7369bc 100644 --- a/src/main.cr +++ b/src/main.cr @@ -1,5 +1,26 @@ require "./**" +HELP = <<-HELP +tartrazine: a syntax highlighting tool + +Usage: + + tartrazine FILE -f html [-t theme][--standalone][--line-numbers] + [-l lexer] [-o output][--css] + tartrazine FILE -f terminal [-t theme][-l lexer][-o output] + tartrazine FILE -f json [-o output] + tartrazine --list-themes + tartrazine --list-lexers + +-f Format to use (html, terminal, json) +-t Theme to use (see --list-themes) +-l Lexer (language) to use (see --list-lexers) +-o Output file (default: stdout) +--standalone Generate a standalone HTML file +--css Generate a CSS file for the theme +--line-numbers Include line numbers in the output +HELP + lexer = Tartrazine.lexer("crystal") theme = Tartrazine.theme(ARGV[1]) formatter = Tartrazine::Html.new