Skip to content

Commit 0a963ab

Browse files
[EDI] Specifying command options in a CodeQL configuration file (#59869)
Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com>
1 parent ca31b28 commit 0a963ab

1 file changed

Lines changed: 12 additions & 24 deletions

File tree

content/code-security/how-tos/scan-code-for-vulnerabilities/scan-from-the-command-line/specifying-command-options-in-a-codeql-configuration-file.md

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Specifying command options in a CodeQL configuration file
33
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.
55
product: '{% data reusables.gated-features.codeql %}'
66
versions:
77
fpt: '*'
@@ -18,36 +18,24 @@ redirect_from:
1818
contentType: how-tos
1919
---
2020

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-
3221
## Using a {% data variables.product.prodname_codeql %} configuration file
3322

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:
3725

38-
```shell
39-
<command> <subcommand> <option> <value>
40-
```
26+
```shell
27+
<command> <subcommand> <option> <value>
28+
```
4129

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:
4331

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>`
4634

4735
> [!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 line overrides 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.
5139

5240
### Examples
5341

0 commit comments

Comments
 (0)