Bump clap from 2.34.0 to 3.1.18 (#2824)

* Bump clap from 2.34.0 to 3.1.18

Bumps [clap](https://github.com/clap-rs/clap) from 2.34.0 to 3.1.18.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v2.34.0...v3.1.18)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* update taskchampion-sync-server for clap 3.x

* bump MSRV to 1.54 for extended_key_value_attributes required by clap

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dustin J. Mitchell <dustin@v.igoro.us>
This commit is contained in:
dependabot[bot] 2022-05-30 12:34:55 -04:00 committed by GitHub
parent a1bd08d6d1
commit e842b66e5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 72 deletions

View file

@ -15,7 +15,7 @@ thiserror = "1.0"
futures = "^0.3.8"
serde = "^1.0.125"
serde_json = "^1.0"
clap = "^2.33.0"
clap = "^3.1.18"
log = "^0.4.17"
env_logger = "^0.9.0"
rusqlite = { version = "0.27", features = ["bundled"] }

View file

@ -1,7 +1,7 @@
#![deny(clippy::all)]
use actix_web::{middleware::Logger, App, HttpServer};
use clap::Arg;
use clap::{arg, Command};
use taskchampion_sync_server::storage::SqliteStorage;
use taskchampion_sync_server::{Server, ServerConfig};
@ -11,45 +11,28 @@ async fn main() -> anyhow::Result<()> {
let defaults = ServerConfig::default();
let default_snapshot_versions = defaults.snapshot_versions.to_string();
let default_snapshot_days = defaults.snapshot_days.to_string();
let matches = clap::App::new("taskchampion-sync-server")
let matches = Command::new("taskchampion-sync-server")
.version(env!("CARGO_PKG_VERSION"))
.about("Server for TaskChampion")
.arg(
Arg::with_name("port")
.short("p")
.long("port")
.value_name("PORT")
arg!(-p --port <PORT> "Port on which to serve")
.help("Port on which to serve")
.default_value("8080")
.takes_value(true)
.required(true),
)
.arg(
Arg::with_name("data-dir")
.short("d")
.long("data-dir")
.value_name("DIR")
.help("Directory in which to store data")
arg!(-d --data-dir <DIR> "Directory in which to store data")
.default_value("/var/lib/taskchampion-sync-server")
.takes_value(true)
.allow_invalid_utf8(true)
.required(true),
)
.arg(
Arg::with_name("snapshot-versions")
.long("snapshot-versions")
.value_name("NUM")
.help("Target number of versions between snapshots")
.default_value(&default_snapshot_versions)
.takes_value(true)
.required(false),
arg!(--snapshot-versions [NUM] "Target number of versions between snapshots")
.default_value(&default_snapshot_versions),
)
.arg(
Arg::with_name("snapshot-days")
.long("snapshot-days")
.value_name("NUM")
.help("Target number of days between snapshots")
arg!(--snapshot-days [NUM] "Target number of days between snapshots")
.default_value(&default_snapshot_days)
.takes_value(true)
.required(false),
)
.get_matches();