/bafishka

🐟 Rust-native Fish shell-friendly file operations with Steel-backed SCI Clojure evaluation (seed: 1069)

Primary LanguageClojure

IES Rust Workspace Rust CI

Overview

  • Workspace root: Cargo.toml with members in crates/*.
  • Crates:
    • core — small library exposing pub fn parse_input_file().
    • app — CLI that reads a file and reports its byte length.

Build & Test

  • Build: cargo build
  • Test: cargo test
  • Lint: cargo clippy --all-targets
  • Format check: cargo fmt -- --check

Library (core)

  • API: core::parse_input_file<P: AsRef<Path>>(path) -> io::Result<String>.
  • Example: cargo run -p core --example read -- Cargo.toml.

CLI (app)

  • Usage: cargo run -p app -- [--input <path>] [--output <file>] [--quiet] [--json]
    • -i, --input <path>: file to read (defaults to Cargo.toml).
    • -o, --output <file>: write result to a file (stdout still prints unless --quiet).
    • -q, --quiet: suppress normal output (errors still go to stderr).
    • --json: emit { "path": "...", "bytes": N } on stdout.
    • -h, --help: show usage.

Examples

  • Default (reads Cargo.toml):
    • cargo run -p app --
  • Explicit path:
    • cargo run -p app -- -i crates/core/Cargo.toml
  • JSON output:
    • cargo run -p app -- --json -i Cargo.toml
  • Write to file:
    • cargo run -p app -- --json -i Cargo.toml -o result.json
  • Quiet success:
    • cargo run -p app -- --quiet -i Cargo.toml

Testing Notes

  • Unit tests live in crates/core/src/lib.rs.
  • Integration tests live in crates/core/tests/.
  • Error cases covered: nonexistent file, reading a directory, and permission-denied on Unix.