This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objdump] Use "--" for long options in --help text
ClosedPublic

Authored by DavidSpickett on Nov 30 2020, 3:58 AM.

Details

Summary

Single dash for these options is not recognised.

Changes found by running this on the --help output
and the user guide:
grep -e ' -[a-zA-Z]\{2,\}'

The user guide was updated in https://reviews.llvm.org/D92305
so no change there.

Diff Detail

Event Timeline

DavidSpickett created this revision.Nov 30 2020, 3:58 AM
Herald added a reviewer: MaskRay. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
DavidSpickett requested review of this revision.Nov 30 2020, 3:58 AM
jhenderson accepted this revision.Nov 30 2020, 4:19 AM

Mostly seems sensible to me. However, you might want to get the opinion of a Mach-O user as to whether the single or double-dash option makes more sense for the Mach-O specific options. I've added a couple of others who I know use Mach-O as reviewers.

This revision is now accepted and ready to land.Nov 30 2020, 4:19 AM

For reference it's listed as --macho in https://llvm.org/docs/CommandGuide/llvm-objdump.html#cmdoption-llvm-objdump-macho. However that page is missing some of the "requires -macho" statements so could be a mistake.

Currently it only accepts --:

$ ./bin/llvm-objdump  /tmp/arm64.o -d -macho
llvm-objdump: Unknown command line argument '-macho'.  Try: './bin/llvm-objdump --help'
llvm-objdump: Did you mean '-h'?
$ ./bin/llvm-objdump  /tmp/arm64.o -d --macho
llvm-objdump: error: /tmp/arm64.o': object is not a Mach-O file type.

But yes, perhaps it is intended to work.

It's quite possible there are mistakes in the llvm-objdump docs - I have attempted to get them somewhat clean, but don't really know much about mach-o nor do I use it at all so it's quite likely I've either missed something or accidentally broken some related documentation in my attempts to clean things up! Alterantively, it's quite possible the docs were in a bad state before I even touched them!

MaskRay accepted this revision.Dec 1 2020, 9:33 AM

Ping on -macho vs --macho question. Anyone else want to chime in?

(thanks for the review so far)