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

[llvm-ar] --help: fix unquoted angle bracket #101364

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

LinuxUserGD
Copy link

@LinuxUserGD LinuxUserGD commented Jul 31, 2024

Changes the argument in llvm-ar help message from -M [<mri-script] to -M [< mri-script]

Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be
notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write
permissions for the repository. In which case you can instead tag reviewers by
name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review
by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate
is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot
Copy link
Collaborator

llvmbot commented Jul 31, 2024

@llvm/pr-subscribers-llvm-binary-utilities

Author: Linux User (LinuxUserGD)

Changes

See ziglang/zig#17337


Full diff: https://github.com/llvm/llvm-project/pull/101364.diff

1 Files Affected:

  • (modified) llvm/tools/llvm-ar/llvm-ar.cpp (+1-1)
diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp
index 3b842b76d5c87..56e9b112bec7a 100644
--- a/llvm/tools/llvm-ar/llvm-ar.cpp
+++ b/llvm/tools/llvm-ar/llvm-ar.cpp
@@ -130,7 +130,7 @@ static void printArHelp(StringRef ToolName) {
          << "USAGE: " + ToolName +
                 " [options] [-]<operation>[modifiers] [relpos] "
                 "[count] <archive> [files]\n"
-         << "       " + ToolName + " -M [<mri-script]\n\n";
+         << "       " + ToolName + " -M [<mri-script>]\n\n";
 
   outs() << ArOptions;
 }

@@ -130,7 +130,7 @@ static void printArHelp(StringRef ToolName) {
<< "USAGE: " + ToolName +
" [options] [-]<operation>[modifiers] [relpos] "
"[count] <archive> [files]\n"
<< " " + ToolName + " -M [<mri-script]\n\n";
<< " " + ToolName + " -M [<mri-script>]\n\n";
Copy link
Member

@MaskRay MaskRay Jul 31, 2024

Choose a reason for hiding this comment

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

This is probably [-M mri-script] since -M is part of the optional part.

Copy link
Author

Choose a reason for hiding this comment

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

Ok, changed it now

Copy link
Member

Choose a reason for hiding this comment

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

I think <> can be removed.

Copy link
Member

@MaskRay MaskRay left a comment

Choose a reason for hiding this comment

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

Consider editing the title ([llvm-ar] --help: fix unquoted angle bracket)

Just change the PR title/descritpion. The git commit message is ignored.

@LinuxUserGD LinuxUserGD changed the title [llvm-ar] Add missing right angle bracket [llvm-ar] --help: fix unquoted angle bracket Jul 31, 2024
Copy link
Collaborator

@jh7370 jh7370 left a comment

Choose a reason for hiding this comment

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

So I don't think the < is actually spurious! llvm-ar only supports reading MRI scripts from stdin, not from a file specified directly on the command-line. In this case, < is intended to represent the "read stdin from file" indicator. I think this would be clearer if there was a space between the < and mri-script.

@LinuxUserGD
Copy link
Author

In this case, < is intended to represent the "read stdin from file" indicator.

I've readded it now with a space, so I guess the syntax would be [-M < mri-script]

@jh7370
Copy link
Collaborator

jh7370 commented Aug 6, 2024

In this case, < is intended to represent the "read stdin from file" indicator.

I've readded it now with a space, so I guess the syntax would be [-M < mri-script]

No, it should be -M [< mri-script]. The tool prints two possible invocations, the first, not touched by this patch, is the "regular" style where you e.g. add files to an archive using something like llvm-ar rc archive.a obj.o. The second line is for using MRI style. The MRI style is only activated when -M is specified, so the -M in that case in compulsory.

Copy link
Collaborator

@jh7370 jh7370 left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants