Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
doc: add string keys only to validate documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobWonisch committed Jan 19, 2022
1 parent 775d8a2 commit a9b8522
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion doc/help/kdb-validate.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## DESCRIPTION

Validate the values of keys below a given name using the loaded validation plugins (eg. range or validation) by reading all values, making them dirty by changing to another value, changing back to original and then writing that back to the key database.
Validate the values of string keys below a given name using the loaded validation plugins (eg. range or validation) by reading all values, making them dirty by changing to another value, changing back to original and then writing that back to the key database.

This command is useful for validating configuration files against
their specifications.
Expand All @@ -16,6 +16,7 @@ and the respective plugins for validation must be loaded
for the backend that was used while mounting.
If a validation is done while using 'kdb set'
the same validation is also done by 'kdb validate'
Only string keys are validated! Binary keys are skipped!

Use -f to do a write test even if the previous read
from the key database has issued warnings.
Expand Down
4 changes: 2 additions & 2 deletions doc/man/man1/kdb-validate.1
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
.SH "SYNOPSIS"
\fBkdb validate\fR
.SH "DESCRIPTION"
Validate the values of keys below a given name using the loaded validation plugins (eg\. range or validation) by reading all values, making them dirty by changing to another value, changing back to original and then writing that back to the key database\.
Validate the values of string keys below a given name using the loaded validation plugins (eg\. range or validation) by reading all values, making them dirty by changing to another value, changing back to original and then writing that back to the key database\.
.P
This command is useful for validating configuration files against their specifications\.
.P
For keys to be validated, they must contain the 'check'\-metakeys and the respective plugins for validation must be loaded for the backend that was used while mounting\. If a validation is done while using 'kdb set' the same validation is also done by 'kdb validate'
For keys to be validated, they must contain the 'check'\-metakeys and the respective plugins for validation must be loaded for the backend that was used while mounting\. If a validation is done while using 'kdb set' the same validation is also done by 'kdb validate' Only string keys are validated! Binary keys are skipped!
.P
Use \-f to do a write test even if the previous read from the key database has issued warnings\.
.SH "OPTIONS"
Expand Down
4 changes: 3 additions & 1 deletion doc/tutorials/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ kdb rm system:/tests/userbackup

## Validate Existing Keys

To check if an existing set of keys can be read and written with the current validation rules `kdb validate` should be used. Validate will read the values of all keys under the point defined as argument in the command line, sets the key value to something different, then back to the original and finally writes that original value back to the key database. All loaded [validation plugins](/src/plugins/README.md) are now used to validate the values of keys with the necessary meta-keys (see above).
To check if an existing set of keys can be read and written with the current validation rules `kdb validate` should be used. Validate will read the values of all string keys under the point defined as argument in the command line, sets the key value to something different, then back to the original and finally writes that original value back to the key database. All loaded [validation plugins](/src/plugins/README.md) are now used to validate the values of keys with the necessary meta-keys (see above).

Only string keys are validated! Binary keys are skipped!

```sh
# mount test config file and set a value
Expand Down
3 changes: 2 additions & 1 deletion src/tools/kdb/validate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ValidateCommand : public Command

virtual std::string getShortHelpText () override
{
return "Validate the values of keys below a given name.";
return "Validate the values of string keys below a given name.";
}

virtual std::string getLongHelpText () override
Expand All @@ -45,6 +45,7 @@ class ValidateCommand : public Command
"for the backend that was used while mounting.\n"
"If a validation is done while using 'kdb set'\n"
"the same validation is also done by 'kdb validate'\n"
"Only string keys are validated!\n"
"\n"
"Use -f to do a write test even if the previous read\n"
"from the key database has issued warnings.";
Expand Down

0 comments on commit a9b8522

Please sign in to comment.