[all-commits] [llvm/llvm-project] 24e737: [llvm-ar] Enforce one-dash form for long options

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed Jan 12 11:33:35 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 24e7371fef0d38bb7eeeb6863356d9b39430494e
      https://github.com/llvm/llvm-project/commit/24e7371fef0d38bb7eeeb6863356d9b39430494e
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-01-12 (Wed, 12 Jan 2022)

  Changed paths:
    M llvm/test/Object/archive-format.test
    A llvm/test/tools/llvm-ar/plugin.test
    M llvm/test/tools/llvm-ar/response.test
    M llvm/test/tools/llvm-ar/version.test
    M llvm/tools/llvm-ar/llvm-ar.cpp

  Log Message:
  -----------
  [llvm-ar] Enforce one-dash form for long options

binutils ar does not support one-dash long options (they conflict with
operation code and modifier flags).

```
% ar -help
ar: invalid option -- 'e'
...
% ar -version
ar: invalid option -- 'e'
...

% ar x --plugin=xx x.a  # ok
% ar x -plugin=xx x.a
ar: two different operation options specified
% ar -plugin=/usr/lib/gcc/x86_64-linux-gnu/10/liblto_plugin.so x x.a
ar: x: No such file or directory
```

Drop one-dash long options to simplify code and match the usual practice for
command line utilities.

Reviewed By: jhenderson

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




More information about the All-commits mailing list