knurling-rs / flip-link

Adds zero-cost stack overflow protection to your embedded programs
Apache License 2.0
279 stars 8 forks source link

Add support for -h/--help arg #102

Closed HaoboGu closed 1 week ago

HaoboGu commented 1 week ago

When use flip-link directly from command line, now flip-link returns an error code 1:

$ flip-link
lld is a generic driver.
Invoke ld.lld (Unix), ld64.lld (macOS), lld-link (Windows), wasm-ld (WebAssembly) instead

flip-link: the native linker failed to link the program normally; please check your project configuration and linker scripts

It's inconvenient when we want to just test whether flip-link exists. In my case, I use cargo-make to automate the build workflow, it checks flip-link command's return code to determine whether to install the crate, so it will re-install flip-link everytime even though flip-link has been installed.

This PR adds -h/--help argument. When user executes flip-link -h or flip-link --help or flip-link in command line, flip-link now returns:

$ flip-link
flip-link: adds zero-cost stack overflow protection to your embedded programs

You should not use flip-link directly from command line, use flip-link as your default linker instead. 
For detailed usage, check https://github.com/knurling-rs/flip-link