1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Merge pull request #6692 from cakebaker/coreutils_add_list_option_to_help

bin/coreutils: add `--list` to help output
This commit is contained in:
Sylvestre Ledru 2024-09-13 08:43:49 +02:00 committed by GitHub
commit db402875f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,7 +21,10 @@ include!(concat!(env!("OUT_DIR"), "/uutils_map.rs"));
fn usage<T>(utils: &UtilityMap<T>, name: &str) { fn usage<T>(utils: &UtilityMap<T>, name: &str) {
println!("{name} {VERSION} (multi-call binary)\n"); println!("{name} {VERSION} (multi-call binary)\n");
println!("Usage: {name} [function [arguments...]]\n"); println!("Usage: {name} [function [arguments...]]");
println!(" {name} --list\n");
println!("Options:");
println!(" --list lists all defined functions, one per row\n");
println!("Currently defined functions:\n"); println!("Currently defined functions:\n");
#[allow(clippy::map_clone)] #[allow(clippy::map_clone)]
let mut utils: Vec<&str> = utils.keys().map(|&s| s).collect(); let mut utils: Vec<&str> = utils.keys().map(|&s| s).collect();