Modelo de projeto·Pro
CLI em Rust: contador de linhas
Uma ferramenta de linha de comando em Rust que conta linhas de código, de comentários e em branco por linguagem em uma pasta. É um projeto Cargo sem dependências e com testes unitários. Precisa de Rust e Cargo no ambiente Linux (cerca de 370 MB).
Para instalar, você precisa do PocketCode Pro.
Se o PocketCode estiver instalado no seu Android, isto abre a página no app.
Prévia
Arquivos
Cargo.lock
Cargo.toml
README.md
src/count.rs
src/main.rsREADME.md
# loc: a Rust command-line tool Counts lines of code, comments and blank lines per language in a folder, like a small `cloc`. It skips `.git`, `target`, `node_modules` and other build or dependency folders. A Cargo project with no dependencies (only the standard library), split into two modules, with unit tests. ## Run it in PocketCode You need the app's Linux environment with Rust and Cargo (install it in Settings › Compilers and runtimes; about 370 MB). 1. Open the terminal in this project's folder (Open Terminal Here, in the editor menu). 2. Build and run it on this project: ```sh cargo run -- . ``` The first build takes a while on a phone; later ones only rebuild what changed. 3. Point it at any folder of your projects, and sort the table: ```sh cargo run -- ../other-project --sort files cargo run -- --help ``` You can also open `src/main.rs` and tap Run: it counts the `src` folder. ## Run the tests ```sh cargo test ``` ## Build a release binary ```sh cargo build --release ./target/release/loc ~/some/folder ``` ## Where things areEsta prévia está encurtada. O conteúdo completo vem com a instalação.
Mudanças na 1.0.0
Primeira versão.