Use clap for command line arguments

To support command line arguments `clap` is used. This adds following
argument `--config`/`-c` to provide a different path for the
configurationf file and the subcommand `configtest` which parses and
loads the configuration and exits.
This commit is contained in:
finga 2021-05-31 16:14:19 +02:00
parent 43b7fd5625
commit d29bfdf88d
3 changed files with 132 additions and 1 deletions

View file

@ -27,6 +27,7 @@ hex = "0.4"
ipnet = { version = "2.3", features = ["serde"] }
thiserror = "1.0"
run_script = "0.7"
clap = "3.0.0-beta.2"
[package.metadata.deb]
extended-description = "Webhookey receives requests in form of a so called Webhook as for example sent by Gitea. Those requests are matched against configured filters, if a filter matches, values from the header and the body can be passed to scripts as parameters which are then executed subsequently."