diff --git a/clang/docs/UsersManual.rst b/clang/docs/UsersManual.rst --- a/clang/docs/UsersManual.rst +++ b/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 ```` 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: :: diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -900,8 +900,9 @@ 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=">, Flags<[NoXarchOption, CoreOption]>, MetaVarName<"">, + HelpText<"Specify configuration file">; +def : Separate<["--"], "config">, Alias; 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]>, diff --git a/clang/test/Driver/config-file.c b/clang/test/Driver/config-file.c --- a/clang/test/Driver/config-file.c +++ b/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