Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 1.35 KB

README.md

File metadata and controls

31 lines (26 loc) · 1.35 KB

tree-rs

A rewrite of tree in Rust.

Restrictions:

  • no modifications to original C code
  • avoid using any external crates unless absolutely necessary
  • don't blindly replicate or copy the original C code but take inspiration (use Rust types)

0.1.0

  • read arguments from the terminal when called
  • print matching (roughly, most flags won't be supported) usage when --help is used
  • return exit code 0
  • print version string (bonus: take from Cargo.toml)
  • handle unsupported argument. Print Invalid argument \--arg`` & usage and return exit code 2
  • write a rust test to confirm the behaviour

0.1.1

  • when called with no args, print X directories, Y files

0.1.2

  • display tree view of directories & files in current working dir
  • sort by name (default behaviour)
  • support -a option (show all files including hidden)
  • support -d option (list directories only)
  • if any directory cannot be opened (permission, etc), return exit code 2. Else return 0 on success

0.1.3

  • support arbitrary list of directories as positional args and perform tree search & display
  • when multiple directories are used, the count of dirs & files includes all locations
  • support -l option (list directories only)
  • write integration test, assert C tree == tree-rs