OSDN Git Service

[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)
commitf0d90ddef56eeaf0e696ce5df8a07f3d32580a6b
tree502e95534582f097660b06c94509377830e85abe
parentbaf32fac2bf72513cf012b86f7c675d1e1ce52fd
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359265 91177308-0d34-0410-b5e6-96231b3b80d8
test/tools/llvm-objcopy/ELF/help-message.test
test/tools/llvm-objcopy/ELF/objcopy-version.test
test/tools/llvm-objcopy/ELF/strip-all.test
test/tools/llvm-objcopy/ELF/strip-version.test
tools/llvm-objcopy/ObjcopyOpts.td
tools/llvm-objcopy/StripOpts.td