Skip to content

Commit

Permalink
Add snakecase for variables made out of two words that had it in no v…
Browse files Browse the repository at this point in the history
…ersion yet (for consistency)
  • Loading branch information
JanHoefelmeyer committed Nov 6, 2023
1 parent a19a68a commit 69f59dc
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 33 deletions.
8 changes: 4 additions & 4 deletions cmd/csaf_aggregator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type provider struct {
UpdateInterval *string `toml:"update_interval"`

// IgnorePattern is a list of patterns of advisory URLs to be ignored.
IgnorePattern []string `toml:"ignorepattern"`
IgnorePattern []string `toml:"ignore_pattern"`

// ExtraHeader adds extra HTTP header fields to client
ExtraHeader http.Header `toml:"header"`
Expand All @@ -63,7 +63,7 @@ type provider struct {
ClientKey *string `toml:"client_key"`
ClientPassphrase *string `toml:"client_passphrase"`

Range *models.TimeRange `toml:"timerange"`
Range *models.TimeRange `toml:"time_range"`

clientCerts []tls.Certificate
ignorePattern filter.PatternMatcher
Expand Down Expand Up @@ -92,7 +92,7 @@ type config struct {
ClientKey *string `toml:"client_key"`
ClientPassphrase *string `toml:"client_passphrase"`

Range *models.TimeRange `long:"timerange" short:"t" description:"RANGE of time from which advisories to download" value-name:"RANGE" toml:"timerange"`
Range *models.TimeRange `long:"time_range" short:"t" description:"RANGE of time from which advisories to download" value-name:"RANGE" toml:"time_range"`

// LockFile tries to lock to a given file.
LockFile *string `toml:"lock_file"`
Expand All @@ -116,7 +116,7 @@ type config struct {
UpdateInterval *string `toml:"update_interval"`

// IgnorePattern is a list of patterns of advisory URLs to be ignored.
IgnorePattern []string `toml:"ignorepattern"`
IgnorePattern []string `toml:"ignore_pattern"`

// ExtraHeader adds extra HTTP header fields to client
ExtraHeader http.Header `toml:"header"`
Expand Down
4 changes: 2 additions & 2 deletions cmd/csaf_checker/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ type config struct {
Version bool `long:"version" description:"Display version of the binary" toml:"-"`
Verbose bool `long:"verbose" short:"v" description:"Verbose output" toml:"verbose"`
Rate *float64 `long:"rate" short:"r" description:"The average upper limit of https operations per second (defaults to unlimited)" toml:"rate"`
Range *models.TimeRange `long:"timerange" short:"t" description:"RANGE of time from which advisories to download" value-name:"RANGE" toml:"timerange"`
IgnorePattern []string `long:"ignorepattern" short:"i" description:"Do not download files if their URLs match any of the given PATTERNs" value-name:"PATTERN" toml:"ignorepattern"`
Range *models.TimeRange `long:"time_range" short:"t" description:"RANGE of time from which advisories to download" value-name:"RANGE" toml:"time_range"`
IgnorePattern []string `long:"ignore_pattern" short:"i" description:"Do not download files if their URLs match any of the given PATTERNs" value-name:"PATTERN" toml:"ignore_pattern"`
ExtraHeader http.Header `long:"header" short:"H" description:"One or more extra HTTP header fields" toml:"header"`
RemoteValidator string `long:"validator" description:"URL to validate documents remotely" value-name:"URL" toml:"validator"`
RemoteValidatorCache string `long:"validator_cache" description:"FILE to cache remote validations" value-name:"FILE" toml:"validator_cache"`
Expand Down
8 changes: 4 additions & 4 deletions cmd/csaf_downloader/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ const (
type config struct {
Directory string `short:"d" long:"directory" description:"DIRectory to store the downloaded files in" value-name:"DIR" toml:"directory"`
Insecure bool `long:"insecure" description:"Do not check TLS certificates from provider" toml:"insecure"`
IgnoreSignatureCheck bool `long:"ignoresigcheck" description:"Ignore signature check results, just warn on mismatch" toml:"ignoresigcheck"`
IgnoreSignatureCheck bool `long:"ignore_sigcheck" description:"Ignore signature check results, just warn on mismatch" toml:"ignore_sigcheck"`
ClientCert *string `long:"client_cert" description:"TLS client certificate file (PEM encoded data)" value-name:"CERT-FILE" toml:"client_cert"`
ClientKey *string `long:"client_key" description:"TLS client private key file (PEM encoded data)" value-name:"KEY-FILE" toml:"client_key"`
ClientPassphrase *string `long:"client_passphrase" description:"Optional passphrase for the client cert (limited, experimental, see doc)" value-name:"PASSPHRASE" toml:"client_passphrase"`
Version bool `long:"version" description:"Display version of the binary" toml:"-"`
NoStore bool `long:"nostore" short:"n" description:"Do not store files" toml:"no_store"`
NoStore bool `long:"no_store" short:"n" description:"Do not store files" toml:"no_store"`
Rate *float64 `long:"rate" short:"r" description:"The average upper limit of https operations per second (defaults to unlimited)" toml:"rate"`
Worker int `long:"worker" short:"w" description:"NUMber of concurrent downloads" value-name:"NUM" toml:"worker"`
Range *models.TimeRange `long:"timerange" short:"t" description:"RANGE of time from which advisories to download" value-name:"RANGE" toml:"timerange"`
Range *models.TimeRange `long:"time_range" short:"t" description:"RANGE of time from which advisories to download" value-name:"RANGE" toml:"time_range"`
Folder string `long:"folder" short:"f" description:"Download into a given subFOLDER" value-name:"FOLDER" toml:"folder"`
IgnorePattern []string `long:"ignorepattern" short:"i" description:"Do not download files if their URLs match any of the given PATTERNs" value-name:"PATTERN" toml:"ignorepattern"`
IgnorePattern []string `long:"ignore_pattern" short:"i" description:"Do not download files if their URLs match any of the given PATTERNs" value-name:"PATTERN" toml:"ignore_pattern"`
ExtraHeader http.Header `long:"header" short:"H" description:"One or more extra HTTP header fields" toml:"header"`

RemoteValidator string `long:"validator" description:"URL to validate documents remotely" value-name:"URL" toml:"validator"`
Expand Down
10 changes: 5 additions & 5 deletions docs/csaf_aggregator.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
csaf_aggregator [OPTIONS]
Application Options:
-t, --timerange=RANGE RANGE of time from which advisories to download
-t, --time_range=RANGE RANGE of time from which advisories to download
-i, --interim Perform an interim scan
--version Display version of the binary
-c, --config=TOML-FILE Path to config TOML file
Expand Down Expand Up @@ -104,12 +104,12 @@ lock_file // path to lockfile, to stop other instances if one is n
interim_years // limiting the years for which interim documents are searched (default 0)
verbose // print more diagnostic output, e.g. https requests (default false)
allow_single_provider // debugging option (default false)
ignorepattern // patterns of advisory URLs to be ignored (see checker doc for details)
ignore_pattern // patterns of advisory URLs to be ignored (see checker doc for details)
client_cert // path to client certificate to access access-protected advisories
client_key // path to client key to access access-protected advisories
client_passphrase // optional client cert passphrase (limited, experimental, see downloader doc)
header // adds extra HTTP header fields to the client
timerange // Accepted time range of advisories to handle. See downloader docs for details.
time_range // Accepted time range of advisories to handle. See downloader docs for details.
```

Next we have two TOML _tables_:
Expand Down Expand Up @@ -139,7 +139,7 @@ category
update_interval
create_service_document
categories
ignorepattern
ignore_pattern
client_cert
client_key
client_passphrase
Expand Down Expand Up @@ -229,7 +229,7 @@ insecure = true
# If aggregator.category == "aggregator", set for an entry that should
# be listed in addition:
category = "lister"
# ignorepattern = [".*white.*", ".*red.*"]
# ignore_pattern = [".*white.*", ".*red.*"]
```
<!-- MARKDOWN-AUTO-DOCS:END -->

Expand Down
6 changes: 3 additions & 3 deletions docs/csaf_checker.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Application Options:
--version Display version of the binary
-v, --verbose Verbose output
-r, --rate= The average upper limit of https operations per second (defaults to unlimited)
-t, --timerange=RANGE RANGE of time from which advisories to download
-i, --ignorepattern=PATTERN Do not download files if their URLs match any of the given PATTERNs
-t, --time_range=RANGE RANGE of time from which advisories to download
-i, --ignore_pattern=PATTERN Do not download files if their URLs match any of the given PATTERNs
-H, --header= One or more extra HTTP header fields
--validator=URL URL to validate documents remotely
--validator_cache=FILE FILE to cache remote validations
Expand Down Expand Up @@ -50,7 +50,7 @@ insecure = false
# client_passphrase # not set by default
verbose = false
# rate # not set by default
# timerange # not set by default
# time_range # not set by default
# header # not set by default
# validator # not set by default
# validator_cache # not set by default
Expand Down
30 changes: 15 additions & 15 deletions docs/csaf_downloader.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@ csaf_downloader [OPTIONS] domain...
Application Options:
-d, --directory=DIR DIRectory to store the downloaded files in
--insecure Do not check TLS certificates from provider
--ignoresigcheck Ignore signature check results, just warn on mismatch
--ignore_sigcheck Ignore signature check results, just warn on mismatch
--client_cert=CERT-FILE TLS client certificate file (PEM encoded data)
--client_key=KEY-FILE TLS client private key file (PEM encoded data)
--client_passphrase=PASSPHRASE Optional passphrase for the client cert (limited, experimental, see doc)
--version Display version of the binary
-n, --nostore Do not store files
-n, --no_store Do not store files
-r, --rate= The average upper limit of https operations per second (defaults to unlimited)
-w, --worker=NUM NUMber of concurrent downloads (default: 2)
-t, --timerange=RANGE RANGE of time from which advisories to download
-t, --time_range=RANGE RANGE of time from which advisories to download
-f, --folder=FOLDER Download into a given subFOLDER
-i, --ignorepattern=PATTERN Do not download files if their URLs match any of the given PATTERNs
-i, --ignore_pattern=PATTERN Do not download files if their URLs match any of the given PATTERNs
-H, --header= One or more extra HTTP header fields
--validator=URL URL to validate documents remotely
--validator_cache=FILE FILE to cache remote validations
--validator_preset=PRESETS One or more PRESETS to validate remotely (default: [mandatory])
-m, --validation_mode=MODE[strict|unsafe] MODE how strict the validation is (default: strict)
--forward_url=URL URL of HTTP endpoint to forward downloads to
--forward_header= One or more extra HTTP header fields used by forwarding
--forward_queue=LENGTH Maximal queue LENGTH before forwarder (default: 5)
--forward_insecure Do not check TLS certificates from forward endpoint
--validator_cache=FILE FILE to cache remote validations
--validator_preset=PRESETS One or more PRESETS to validate remotely (default: [mandatory])
-m, --validation_mode=MODE[strict|unsafe] MODE how strict the validation is (default: strict)
--forward_url=URL URL of HTTP endpoint to forward downloads to
--forward_header= One or more extra HTTP header fields used by forwarding
--forward_queue=LENGTH Maximal queue LENGTH before forwarder (default: 5)
--forward_insecure Do not check TLS certificates from forward endpoint
--logfile=FILE FILE to log downloading to (default: downloader.log)
--loglevel=LEVEL[debug|info|warn|error] LEVEL of logging details (default: info)
-c, --config=TOML-FILE Path to config TOML file
Expand Down Expand Up @@ -65,13 +65,13 @@ insecure = false
ignoresigcheck = false
# rate # set to unlimited
worker = 2
# timerange # not set by default
# time_range # not set by default
# folder # not set by default
# ignorepattern # not set by default
# ignore_pattern # not set by default
# header # not set by default
# validator # not set by default
# validator_cache # not set by default
validator_preset = ["mandatory"]
# validator_cache # not set by default
validator_preset = ["mandatory"]
validation_mode = "strict"
# forward_url # not set by default
# forward_header # not set by default
Expand Down

0 comments on commit 69f59dc

Please sign in to comment.