Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to display all supported languages #69

Closed
sharkdp opened this issue May 6, 2018 · 4 comments
Closed

Add option to display all supported languages #69

sharkdp opened this issue May 6, 2018 · 4 comments
Labels
feature-request New feature or request good first issue Good for newcomers

Comments

@sharkdp
Copy link
Owner

sharkdp commented May 6, 2018

Maybe:

> bat --list-languages
ActionScript			as
AppleScript				applescript
ASP						asa
Batch File				bat, cmd
C#						cs, csx
...

See: https://docs.rs/syntect/2.0.1/syntect/parsing/struct.SyntaxSet.html#method.syntaxes

@sharkdp sharkdp added feature-request New feature or request good first issue Good for newcomers labels May 6, 2018
@connorkuehl
Copy link
Contributor

connorkuehl commented May 7, 2018

I'd like to work on this. I played around with it a little bit and I have the basic functionality working as described above.

./target/debug/bat.exe --help
bat 0.2.3
A cat(1) clone with wings.

USAGE:
    bat.exe [OPTIONS] [FILE]... [SUBCOMMAND]

OPTIONS:
---snipped---

        --list-languages
            Displays supported languages

--snipped--

Like this:

Batch File                      bat, cmd
NAnt Build File                 build
C#                      cs, csx
C++                     cpp, cc, cp, cxx, c++, C, h, hh, hpp, hxx, h++, inl, ipp
C                       c, h
CSS                     css, css.erb, css.liquid
Clojure                 clj
D                       d, di
Diff                    diff, patch

I'll need to work up something a bit more flexible if we want all the columns to line up correctly; some language names are very long/have a lot of extensions and this breaks out of the tabbed columns.

@sharkdp
Copy link
Owner Author

sharkdp commented May 7, 2018

Cool, thank you very much! Getting the longest syntax name first should be fine. It's not like this has to be performance-optimized in any sense.

@sharkdp
Copy link
Owner Author

sharkdp commented May 7, 2018

(also: bat works on Windows just like that? nice! 😄)

@connorkuehl
Copy link
Contributor

connorkuehl commented May 7, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants