An ls clone written in Rust, mostly done so that I can learn Rust.
Note
This project uses pre-commit-hooks, to make use of them
please install pre-commit. To set up the hooks run just setup_precommit, if just is not
installed please install it with either apt or brew depending on your os.
You can build the project a couple of ways that depending on the tooling that you have installed, assuming you have cargo
installed run:
cargo clean
cargo build --workspaceIf you have just installed run, this will run, clean, build and check:
just cbuildNote
Keep in mind that the binary will most likely be a dev version of the binary depending on how you compiled it, meaning
you will have to run ./target/dev|release/lx
Once compiled, you can use it just as you would use ls (for the most part) here is the help:
List files and directories within a directory.
Usage: lx [OPTIONS] [DIRECTORY]
Arguments:
[DIRECTORY] Name of the directory [default: .]
Options:
-p, --permissions Show file permissions
-a, --all Show all items
-h, --help Print help
-V, --version Print versionThere is a couple of options when installing the binary:
To build from source and install with cargo:
just build_release
cargo install --path . Download the binary from the releases tab on GitHub and once installed, move the binary with the below commands:
chmod +x ~/Downloads/lx
mv ~/Downloads/lx /usr/local/bin/