[llvm-objcopy] Accept --long-option but not -long-option
authorFangrui Song <maskray@google.com>
Fri, 26 Apr 2019 02:10:10 +0000 (02:10 +0000)
committerFangrui Song <maskray@google.com>
Fri, 26 Apr 2019 02:10:10 +0000 (02:10 +0000)
commit2db79e9d2cacc7a387d3e1e6bf0f6ac0a7d5d292
treef9e9ccdcef9c81438e8e9a60cc98bb462fd3e291
parent48e7a2fa8cf072749b8f7b1baa7aaa38e710b68d
[llvm-objcopy] Accept --long-option but not -long-option

Summary:

llvm-{objcopy,strip} (and many other LLVM binary utilities) accept
cl::opt style -long-option as well as many short options (e.g. -p -S
-x). People who use them as replacement of GNU binutils often use the
grouped option syntax (POSIX Utility Conventions), e.g. -Sx => -S -x,
-Wd => -W -d, -sj.text => -s -j.text

There is ambiguity if a long option starts with the character used by a
short option. Drop the support for -long-option to resolve the ambiguity.

This divergence from other utilities is accepted (other utilities
continue supporting -long-option).
https://lists.llvm.org/pipermail/llvm-dev/2019-April/131786.html

Reviewers: alexshap, jakehehrlich, jhenderson, rupprecht, espindola

Reviewed By: jakehehrlich, jhenderson, rupprecht

Subscribers: grimar, emaste, arichardson, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60439

llvm-svn: 359265
llvm/test/tools/llvm-objcopy/ELF/help-message.test
llvm/test/tools/llvm-objcopy/ELF/objcopy-version.test
llvm/test/tools/llvm-objcopy/ELF/strip-all.test
llvm/test/tools/llvm-objcopy/ELF/strip-version.test
llvm/tools/llvm-objcopy/ObjcopyOpts.td
llvm/tools/llvm-objcopy/StripOpts.td