Skip to content

Commit

Permalink
bump clap and use crate_version macro
Browse files Browse the repository at this point in the history
Signed-off-by: Akshat Agarwal <humancalico@disroot.org>
  • Loading branch information
akshatagarwl committed Sep 4, 2021
1 parent 7f6bc2c commit c7a99f7
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 34 deletions.
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

0 comments on commit c7a99f7

Please sign in to comment.