Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Oct 28, 2024
Merged

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

merged 2 commits into from
Oct 28, 2024

Conversation

HaoboGu
Copy link
Contributor

@HaoboGu HaoboGu commented Oct 28, 2024

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

Copy link
Member

@Urhengulas Urhengulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

src/main.rs Outdated Show resolved Hide resolved
@HaoboGu HaoboGu requested a review from Urhengulas October 28, 2024 14:53
Copy link
Member

@Urhengulas Urhengulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry, I put in a mistake in my recommendation. Can you please fix it, add a CHANGELOG entry and squash all of it into one commit please?

src/main.rs Outdated Show resolved Hide resolved
Signed-off-by: Haobo Gu <haobogu@outlook.com>
src/main.rs Outdated Show resolved Hide resolved
Copy link
Member

@Urhengulas Urhengulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution and thank you for bearing with me 😉

@Urhengulas Urhengulas enabled auto-merge October 28, 2024 16:34
@Urhengulas Urhengulas added this pull request to the merge queue Oct 28, 2024
Merged via the queue into knurling-rs:main with commit 515c54c Oct 28, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants