You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/code-security/how-tos/scan-code-for-vulnerabilities/scan-from-the-command-line/specifying-command-options-in-a-codeql-configuration-file.md
+12-24Lines changed: 12 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Specifying command options in a CodeQL configuration file
3
3
shortTitle: Specify command options in a CodeQL configuration file
4
-
intro: You can save default command options in a {% data variables.product.prodname_codeql %} configuration file.
4
+
intro: Save time by adding your frequently used command options and custom {% data variables.product.prodname_codeql %} packs to a {% data variables.product.prodname_codeql %} configuration file.
5
5
product: '{% data reusables.gated-features.codeql %}'
6
6
versions:
7
7
fpt: '*'
@@ -18,36 +18,24 @@ redirect_from:
18
18
contentType: how-tos
19
19
---
20
20
21
-
## About specifying command options in a {% data variables.product.prodname_codeql %} configuration file
22
-
23
-
You can save default or frequently used options for your commands in a per-user configuration file.
24
-
25
-
You can specify {% data variables.product.prodname_codeql_cli %} command options in two ways:
26
-
27
-
* Directly in the command line, using the appropriate flag.
28
-
* In a configuration (or `config`) file that {% data variables.product.prodname_codeql %} scans for relevant options each time a command is executed.
29
-
30
-
For options that are likely to change each time you execute a command, specifying the value on the command line is the most convenient way of passing the information to {% data variables.product.prodname_codeql %}. Saving options in a `config` file is a good way to specify options you use frequently. It’s also a good way to add custom {% data variables.product.prodname_codeql %} packs that you use regularly to your search path.
31
-
32
21
## Using a {% data variables.product.prodname_codeql %} configuration file
33
22
34
-
You need to save the `config` file under your home (Linux and macOS) or user profile (Windows) directory in the `.config/codeql/` subdirectory. For example, `$HOME/.config/codeql/config`.
35
-
36
-
The syntax for specifying options is as follows:
23
+
1. Create and save a `config` file under your home (Linux and macOS) or user profile (Windows) directory in the `.config/codeql/` subdirectory. For example, `$HOME/.config/codeql/config`.
24
+
1. In the `config` file, specify the options you want to apply to your {% data variables.product.prodname_codeql %} commands. The syntax for specifying options is as follows:
37
25
38
-
```shell
39
-
<command><subcommand><option><value>
40
-
```
26
+
```shell
27
+
<command><subcommand><option><value>
28
+
```
41
29
42
-
To apply the same options to more than one command you can:
30
+
1. To apply the same options to more than one command, you can:
43
31
44
-
* Omit the `<subcommand>`, which will specify the option for every `<subcommand>` to which it’s relevant.
45
-
* Omit both `<command>` and `<subcommand>`, which will globally specify the option for every `<command>` and `<subcommand>` to which it’s relevant.
32
+
* Omit `<subcommand>`, which will specify the option for every relevant `<subcommand>`
33
+
* Omit both `<command>` and `<subcommand>`, which will specify the option globally for every relevant `<command>` and `<subcommand>`
46
34
47
35
> [!NOTE]
48
-
> *`config` files only accept spaces between option flags and values—{% data variables.product.prodname_codeql %} will throw an error if you use `=` to specify an option value.
49
-
> *If you specify an option in the command line, this overrides the`config` value defined for that option.
50
-
> *If you want to specify more than one option for a `<command>`, `<subcommand>` or globally, use one line per option.
36
+
>*`config` files only accept spaces, not `=`, between option flags and values.
37
+
>*Specifying an option on the command lineoverrides any`config` value defined for that option.
38
+
>*To specify more than one option for a `<command>`, `<subcommand>`, or globally, use one line per option.
0 commit comments