#comments #source #sdk #extractor #cli #binary #finder

bin+lib commentator

Source code comments extractor binary and SDK

3 releases (breaking)

0.2.3 Feb 3, 2022
0.1.0 Jan 24, 2022
0.0.1 Jan 14, 2022

#2327 in Development tools

MIT license

24KB
544 lines

Commentator is a fucking fast source code comments finder CLI and Rust SDK (crate).

work in progress.

Check

Crates v0.1.0

Motivation

Existing source code comments extractors (see References) forcomments extracting are quite slow, not always accurate (don't find all comments) or doesn't provide SDK. This tool fixes all of this.

Usage

This library could be used as CLI or from code.

To build CLI from sources (you need Rust and Cargo installed):

# clone repo
git clone https://github.com/g4s8/commentator.git
cd commentator
# build with cargo
cargo build --release --bin commentator --features feat-bin
# move binary to your $PATH
sudo mv ./target/release/commentator /usr/local/bin

Or download from release pages: https://github.com/g4s8/commentator/releases/tag/0.1.0

CLI usage

commentator require file name argument and supports these options:

  • --format - output format: either plain or json
  • --lang - language comment specification, one of:
    • c,java, go, cpp - for C-like comment syntax
    • rust - Rust comments syntax
    • bash - for Bash, Python and Ruby
    • html - for HTML, XML
  • --trim - trim comment symbols and whitespaces, align to the first sentence indent.

Example:

./commentator --format=json --lang=java filename.java

SDK usage

TODO: SDK usage

References

Dependencies

~415KB