Compare commits
2 commits
83d8cd2d54
...
df0a909c00
Author | SHA1 | Date | |
---|---|---|---|
df0a909c00 | |||
6a79d5adf1 |
|
@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [v0.5.1] - 2022-04-03
|
||||||
|
### Fixed
|
||||||
|
- shell completion for config file now completes files
|
||||||
|
|
||||||
## [v0.5.0] - 2022-04-02
|
## [v0.5.0] - 2022-04-02
|
||||||
### Added
|
### Added
|
||||||
- shell completion generation
|
- shell completion generation
|
||||||
|
|
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -768,7 +768,7 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "peshming"
|
name = "peshming"
|
||||||
version = "0.5.0"
|
version = "0.5.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-anyhow-logger",
|
"async-anyhow-logger",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "peshming"
|
name = "peshming"
|
||||||
version = "0.5.0"
|
version = "0.5.1"
|
||||||
license = "AGPL-3.0-only"
|
license = "AGPL-3.0-only"
|
||||||
authors = ["Jan Christian Grünhage <jan.christian@gruenhage.xyz>"]
|
authors = ["Jan Christian Grünhage <jan.christian@gruenhage.xyz>"]
|
||||||
repository = "https://git.jcg.re/jcgruenhage/peshming"
|
repository = "https://git.jcg.re/jcgruenhage/peshming"
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
|
use clap::ValueHint;
|
||||||
|
|
||||||
#[derive(clap::Parser)]
|
#[derive(clap::Parser)]
|
||||||
#[clap(author, version)]
|
#[clap(author, version)]
|
||||||
/// Pings configured hosts in a configurable intervals and exposes metrics for prometheus.
|
/// Pings configured hosts in a configurable intervals and exposes metrics for prometheus.
|
||||||
pub struct Cli {
|
pub struct Cli {
|
||||||
/// Set config file
|
/// Set config file
|
||||||
pub config: String,
|
#[clap(value_hint = ValueHint::FilePath)]
|
||||||
|
pub config: std::path::PathBuf,
|
||||||
#[clap(short, long, parse(from_occurrences))]
|
#[clap(short, long, parse(from_occurrences))]
|
||||||
/// Be verbose (you can add this up to 4 times for more logs).
|
/// Be verbose (you can add this up to 4 times for more logs).
|
||||||
/// By default, only errors are logged, so no output is a good thing.
|
/// By default, only errors are logged, so no output is a good thing.
|
||||||
|
|
|
@ -103,7 +103,7 @@ fn setup_fern(level: log::LevelFilter) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn read_config(path: &str) -> Result<Config> {
|
fn read_config(path: &std::path::Path) -> Result<Config> {
|
||||||
let config_file_content = std::fs::read_to_string(path).context("Couldn't read config file")?;
|
let config_file_content = std::fs::read_to_string(path).context("Couldn't read config file")?;
|
||||||
toml::from_str(&config_file_content).context("Couldn't parse config file")
|
toml::from_str(&config_file_content).context("Couldn't parse config file")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue