Skip to content

Fork of tree written in Rust (because why not)

License

Notifications You must be signed in to change notification settings

coopernetes/tree-rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Fork of tree written in Rust (because why not)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%