Compare commits

...

2 commits

Author SHA1 Message Date
Jan Christian Grünhage df0a909c00 chore: bump version to 0.5.1 2022-04-03 01:53:03 +02:00
Jan Christian Grünhage 6a79d5adf1 fix: config file completion completing files 2022-04-03 01:49:46 +02:00
5 changed files with 11 additions and 4 deletions

View file

@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [v0.5.1] - 2022-04-03
### Fixed
- shell completion for config file now completes files
## [v0.5.0] - 2022-04-02
### Added
- shell completion generation

2
Cargo.lock generated
View file

@ -768,7 +768,7 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
[[package]]
name = "peshming"
version = "0.5.0"
version = "0.5.1"
dependencies = [
"anyhow",
"async-anyhow-logger",

View file

@ -1,6 +1,6 @@
[package]
name = "peshming"
version = "0.5.0"
version = "0.5.1"
license = "AGPL-3.0-only"
authors = ["Jan Christian Grünhage <jan.christian@gruenhage.xyz>"]
repository = "https://git.jcg.re/jcgruenhage/peshming"

View file

@ -1,9 +1,12 @@
use clap::ValueHint;
#[derive(clap::Parser)]
#[clap(author, version)]
/// Pings configured hosts in a configurable intervals and exposes metrics for prometheus.
pub struct Cli {
/// Set config file
pub config: String,
#[clap(value_hint = ValueHint::FilePath)]
pub config: std::path::PathBuf,
#[clap(short, long, parse(from_occurrences))]
/// 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.

View file

@ -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")?;
toml::from_str(&config_file_content).context("Couldn't parse config file")
}