Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump clap and use crate_version macro #259

Merged
merged 1 commit into from
Sep 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ default = ["systemd_cgroups"]
systemd_cgroups = ["systemd"]

[dependencies.clap]
version = "3.0.0-beta.2"
version = "3.0.0-beta.4"
default-features = false
features = ["std", "suggestions", "derive"]
features = ["std", "suggestions", "derive", "cargo"]

[dependencies]
nix = "0.22.0"
Expand Down
32 changes: 16 additions & 16 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::path::PathBuf;

use anyhow::bail;
use anyhow::Result;
use clap::Clap;
use clap::{crate_version, Clap};

use nix::sys::stat::Mode;
use nix::unistd::getuid;
Expand All @@ -32,7 +32,7 @@ use youki::utils::{self, create_dir_all_with_mode};
// This takes global options as well as individual commands as specified in [OCI runtime-spec](https://github.com/opencontainers/runtime-spec/blob/master/runtime.md)
// Also check [runc commandline documentation](https://github.com/opencontainers/runc/blob/master/man/runc.8.md) for more explanation
#[derive(Clap, Debug)]
#[clap(version = "0.0.0", author = "youki team")]
#[clap(version = crate_version!(), author = "youki team")]
struct Opts {
/// root directory to store container state
#[clap(short, long)]
Expand All @@ -53,33 +53,33 @@ struct Opts {
// Also for a short information, check [runc commandline documentation](https://github.com/opencontainers/runc/blob/master/man/runc.8.md)
#[derive(Clap, Debug)]
enum SubCommand {
#[clap(version = "0.0.0", author = "youki team")]
#[clap(version = crate_version!(), author = "youki team")]
Create(create::Create),
#[clap(version = "0.0.0", author = "youki team")]
#[clap(version = crate_version!(), author = "youki team")]
Start(start::Start),
#[clap(version = "0.0.0", author = "youki team")]
#[clap(version = crate_version!(), author = "youki team")]
Run(run::Run),
#[clap(version = "0.0.0", author = "youki team")]
#[clap(version = crate_version!(), author = "youki team")]
Exec(exec::Exec),
#[clap(version = "0.0.0", author = "youki team")]
#[clap(version = crate_version!(), author = "youki team")]
Kill(kill::Kill),
#[clap(version = "0.0.0", author = "youki team")]
#[clap(version = crate_version!(), author = "youki team")]
Delete(delete::Delete),
#[clap(version = "0.0.0", author = "youki team")]
#[clap(version = crate_version!(), author = "youki team")]
State(state::State),
#[clap(version = "0.0.0", author = "youki team")]
#[clap(version = crate_version!(), author = "youki team")]
Info(info::Info),
#[clap(version = "0.0.0", author = "youki team")]
#[clap(version = crate_version!(), author = "youki team")]
Spec(spec_json::SpecJson),
#[clap(version = "0.0.0", author = "youki team")]
#[clap(version = crate_version!(), author = "youki team")]
List(list::List),
#[clap(version = "0.0.0", author = "youki team")]
#[clap(version = crate_version!(), author = "youki team")]
Pause(pause::Pause),
#[clap(version = "0.0.0", author = "youki team")]
#[clap(version = crate_version!(), author = "youki team")]
Resume(resume::Resume),
#[clap(version = "0.0.0", author = "youki team")]
#[clap(version = crate_version!(), author = "youki team")]
Events(events::Events),
#[clap(version = "0.0.0", author = "youki team", setting=clap::AppSettings::AllowLeadingHyphen)]
#[clap(version = crate_version!(), author = "youki team", setting=clap::AppSettings::AllowLeadingHyphen)]
Ps(ps::Ps),
}

Expand Down