MaskRay created this revision. MaskRay added reviewers: mgorny, sepavloff. Herald added a subscriber: StephenFan. Herald added a project: All. MaskRay requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
Driver options usually use `Joined` instead of `Separate`. It is also weird that `--config-system-dir=`/etc exist while `--config=` did not exist. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D134790 Files: clang/docs/UsersManual.rst clang/include/clang/Driver/Options.td clang/test/Driver/config-file.c Index: clang/test/Driver/config-file.c =================================================================== --- clang/test/Driver/config-file.c +++ clang/test/Driver/config-file.c @@ -8,6 +8,7 @@ //--- Config file (full path) in output of -### // // RUN: %clang --config %S/Inputs/config-1.cfg -S %s -### 2>&1 | FileCheck %s -check-prefix CHECK-HHH +// RUN: %clang --config=%S/Inputs/config-1.cfg -S %s -### 2>&1 | FileCheck %s -check-prefix CHECK-HHH // CHECK-HHH: Configuration file: {{.*}}Inputs{{.}}config-1.cfg // CHECK-HHH: -Werror // CHECK-HHH: -std=c99 Index: clang/include/clang/Driver/Options.td =================================================================== --- clang/include/clang/Driver/Options.td +++ clang/include/clang/Driver/Options.td @@ -900,8 +900,8 @@ def client__name : JoinedOrSeparate<["-"], "client_name">; def combine : Flag<["-", "--"], "combine">, Flags<[NoXarchOption, Unsupported]>; def compatibility__version : JoinedOrSeparate<["-"], "compatibility_version">; -def config : Separate<["--"], "config">, Flags<[NoXarchOption, CoreOption]>, - HelpText<"Specifies configuration file">; +def config : Joined<["--"], "config=">, MetaVarName<"<file>">, HelpText<"Specify configuration file">; +def : Separate<["--"], "config">, Flags<[NoXarchOption, CoreOption]>, Alias<config>; def no_default_config : Flag<["--"], "no-default-config">, Flags<[NoXarchOption, CoreOption]>, HelpText<"Disable loading default configuration files">; def config_system_dir_EQ : Joined<["--"], "config-system-dir=">, Flags<[NoXarchOption, CoreOption, HelpHidden]>, Index: clang/docs/UsersManual.rst =================================================================== --- clang/docs/UsersManual.rst +++ clang/docs/UsersManual.rst @@ -887,14 +887,14 @@ from default locations. If both variants are present, the default configuration files are loaded first. -The command line option ``--config`` can be used to specify explicit +The command line option ``--config=`` can be used to specify explicit configuration files in a Clang invocation. If the option is used multiple times, all specified files are loaded, in order. For example: :: - clang --config /home/user/cfgs/testing.txt - clang --config debug.cfg --config runtimes.cfg + clang --config=/home/user/cfgs/testing.txt + clang --config=debug.cfg --config=runtimes.cfg If the provided argument contains a directory separator, it is considered as a file path, and options are read from that file. Otherwise the argument is @@ -966,7 +966,7 @@ In cases where a configuration file is deployed alongside SDK contents, the SDK directory can remain fully portable by using ``<CFGDIR>`` prefixed paths. In this way, the user may only need to specify a root configuration file with -``--config`` to establish every aspect of the SDK with the compiler: +``--config=`` to establish every aspect of the SDK with the compiler: ::
Index: clang/test/Driver/config-file.c =================================================================== --- clang/test/Driver/config-file.c +++ clang/test/Driver/config-file.c @@ -8,6 +8,7 @@ //--- Config file (full path) in output of -### // // RUN: %clang --config %S/Inputs/config-1.cfg -S %s -### 2>&1 | FileCheck %s -check-prefix CHECK-HHH +// RUN: %clang --config=%S/Inputs/config-1.cfg -S %s -### 2>&1 | FileCheck %s -check-prefix CHECK-HHH // CHECK-HHH: Configuration file: {{.*}}Inputs{{.}}config-1.cfg // CHECK-HHH: -Werror // CHECK-HHH: -std=c99 Index: clang/include/clang/Driver/Options.td =================================================================== --- clang/include/clang/Driver/Options.td +++ clang/include/clang/Driver/Options.td @@ -900,8 +900,8 @@ def client__name : JoinedOrSeparate<["-"], "client_name">; def combine : Flag<["-", "--"], "combine">, Flags<[NoXarchOption, Unsupported]>; def compatibility__version : JoinedOrSeparate<["-"], "compatibility_version">; -def config : Separate<["--"], "config">, Flags<[NoXarchOption, CoreOption]>, - HelpText<"Specifies configuration file">; +def config : Joined<["--"], "config=">, MetaVarName<"<file>">, HelpText<"Specify configuration file">; +def : Separate<["--"], "config">, Flags<[NoXarchOption, CoreOption]>, Alias<config>; def no_default_config : Flag<["--"], "no-default-config">, Flags<[NoXarchOption, CoreOption]>, HelpText<"Disable loading default configuration files">; def config_system_dir_EQ : Joined<["--"], "config-system-dir=">, Flags<[NoXarchOption, CoreOption, HelpHidden]>, Index: clang/docs/UsersManual.rst =================================================================== --- clang/docs/UsersManual.rst +++ clang/docs/UsersManual.rst @@ -887,14 +887,14 @@ from default locations. If both variants are present, the default configuration files are loaded first. -The command line option ``--config`` can be used to specify explicit +The command line option ``--config=`` can be used to specify explicit configuration files in a Clang invocation. If the option is used multiple times, all specified files are loaded, in order. For example: :: - clang --config /home/user/cfgs/testing.txt - clang --config debug.cfg --config runtimes.cfg + clang --config=/home/user/cfgs/testing.txt + clang --config=debug.cfg --config=runtimes.cfg If the provided argument contains a directory separator, it is considered as a file path, and options are read from that file. Otherwise the argument is @@ -966,7 +966,7 @@ In cases where a configuration file is deployed alongside SDK contents, the SDK directory can remain fully portable by using ``<CFGDIR>`` prefixed paths. In this way, the user may only need to specify a root configuration file with -``--config`` to establish every aspect of the SDK with the compiler: +``--config=`` to establish every aspect of the SDK with the compiler: ::
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits