diff --git a/src/main.rs b/src/main.rs index 641d767..bb54752 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,10 +30,13 @@ fn notmain() -> Result { let raw_args = env::args().skip(1).collect::>(); // If there's no argument provided, print the help message - if raw_args.is_empty() - || (raw_args.len() == 1 && (raw_args[0] == "--help" || raw_args[0] == "-h")) - { - eprintln!("flip-link: adds zero-cost stack overflow protection to your embedded programs\nYou should not use flip-link directly from command line, use flip-link as your default linker instead. \n\nFor detailed usage, check https://github.com/knurling-rs/flip-link"); + if matches!(a.as_slice(), [] | ["--help" | "-h"]) { + eprintln!( + "flip-link: adds zero-cost stack overflow protection to your \ + embedded programs\nYou should not use flip-link directly from \ + command line, use flip-link as your default linker instead. \n\n\ + For detailed usage, check https://github.com/knurling-rs/flip-link" + ); return Ok(0); }