onur / cargo-license

Cargo subcommand to see license of dependencies
MIT License
418 stars 37 forks source link

Add -o/--output option for file output #75

Open JohnCMoon opened 7 months ago

JohnCMoon commented 7 months ago

Currently, there's no way to write program output to a file other than using shell redirection. In some cases, such as containerized CI jobs that may not have a shell, this leaves no way to write the output to file.

In my specific case, I'm using Earthly's Rust library which wraps Cargo for improved caching in CI. Unfortunately, there's no way to write the output of cargo-license to a file using their interface to cargo. I'd be able to do it with an option like this though!

hvanbin commented 7 months ago

Good idea! I'm often in shell-less environments, and this would be helpful!