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
20 lines
1.0 KiB
Plaintext
20 lines
1.0 KiB
Plaintext
# RUN: llvm-objcopy -h | FileCheck --check-prefix=OBJCOPY-USAGE %s
|
|
# RUN: llvm-objcopy --help | FileCheck --check-prefix=OBJCOPY-USAGE %s
|
|
# RUN: not llvm-objcopy 2>&1 | FileCheck --check-prefix=OBJCOPY-USAGE %s
|
|
# RUN: not llvm-objcopy -abcabc 2>&1 | FileCheck --check-prefix=UNKNOWN-ARG %s
|
|
# RUN: not llvm-objcopy --abcabc 2>&1 | FileCheck --check-prefix=UNKNOWN-ARG %s
|
|
# RUN: not llvm-objcopy --strip-debug 2>&1 | FileCheck %s --check-prefix=NO-INPUT-FILES
|
|
|
|
# RUN: llvm-strip -h | FileCheck --check-prefix=STRIP-USAGE %s
|
|
# RUN: llvm-strip --help | FileCheck --check-prefix=STRIP-USAGE %s
|
|
# RUN: not llvm-strip 2>&1 | FileCheck --check-prefix=STRIP-USAGE %s
|
|
# RUN: not llvm-strip -abcabc 2>&1 | FileCheck --check-prefix=UNKNOWN-ARG %s
|
|
# RUN: not llvm-strip --abcabc 2>&1 | FileCheck --check-prefix=UNKNOWN-ARG %s
|
|
# RUN: not llvm-strip --strip-debug 2>&1 | FileCheck %s --check-prefix=NO-INPUT-FILES
|
|
|
|
|
|
# OBJCOPY-USAGE: USAGE: llvm-objcopy
|
|
# STRIP-USAGE: USAGE: llvm-strip
|
|
# UNKNOWN-ARG: unknown argument '{{-+}}abcabc'
|
|
# NO-INPUT-FILES: No input file specified
|