mirror of
https://github.com/containers/youki
synced 2024-05-05 15:16:16 +02:00
Merge pull request #305 from YJDoc2/make_id_nonempty
Forbid empty string values for container id in commands
This commit is contained in:
commit
74ed6304cd
|
@ -23,6 +23,7 @@ pub struct Create {
|
|||
#[clap(long, default_value = "0")]
|
||||
preserve_fds: i32,
|
||||
/// name of the container instance to be started
|
||||
#[clap(forbid_empty_values = true, required = true)]
|
||||
pub container_id: String,
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ use nix::sys::signal as nix_signal;
|
|||
|
||||
#[derive(Clap, Debug)]
|
||||
pub struct Delete {
|
||||
#[clap(forbid_empty_values = true, required = true)]
|
||||
container_id: String,
|
||||
/// forces deletion of the container if it is still running (using SIGKILL)
|
||||
#[clap(short, long)]
|
||||
|
|
|
@ -16,6 +16,7 @@ pub struct Events {
|
|||
#[clap(long)]
|
||||
pub stats: bool,
|
||||
/// Name of the container instance
|
||||
#[clap(forbid_empty_values = true, required = true)]
|
||||
pub container_id: String,
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ pub struct Exec {
|
|||
#[clap(short, long)]
|
||||
pub detach: bool,
|
||||
/// Identifier of the container
|
||||
#[clap(forbid_empty_values = true, required = true)]
|
||||
pub container_id: String,
|
||||
/// Command that should be executed in the container
|
||||
#[clap(required = false)]
|
||||
|
|
|
@ -12,6 +12,7 @@ use crate::{
|
|||
|
||||
#[derive(Clap, Debug)]
|
||||
pub struct Kill {
|
||||
#[clap(forbid_empty_values = true, required = true)]
|
||||
container_id: String,
|
||||
signal: String,
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ use cgroups::common::FreezerState;
|
|||
/// Structure to implement pause command
|
||||
#[derive(Clap, Debug)]
|
||||
pub struct Pause {
|
||||
#[clap(forbid_empty_values = true, required = true)]
|
||||
pub container_id: String,
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ pub struct Ps {
|
|||
/// format to display processes: table or json (default: "table")
|
||||
#[clap(short, long, default_value = "table")]
|
||||
format: String,
|
||||
#[clap(forbid_empty_values = true, required = true)]
|
||||
pub container_id: String,
|
||||
/// options will be passed to the ps utility
|
||||
#[clap(setting = clap::ArgSettings::Last)]
|
||||
|
|
|
@ -14,6 +14,7 @@ use cgroups::common::FreezerState;
|
|||
/// Structure to implement resume command
|
||||
#[derive(Clap, Debug)]
|
||||
pub struct Resume {
|
||||
#[clap(forbid_empty_values = true, required = true)]
|
||||
pub container_id: String,
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ pub struct Run {
|
|||
#[clap(long, default_value = "0")]
|
||||
preserve_fds: i32,
|
||||
/// name of the container instance to be started
|
||||
#[clap(forbid_empty_values = true, required = true)]
|
||||
pub container_id: String,
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ use crate::notify_socket::{NotifySocket, NOTIFY_FILE};
|
|||
|
||||
#[derive(Clap, Debug)]
|
||||
pub struct Start {
|
||||
#[clap(forbid_empty_values = true, required = true)]
|
||||
pub container_id: String,
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ use crate::container::Container;
|
|||
|
||||
#[derive(Clap, Debug)]
|
||||
pub struct State {
|
||||
#[clap(forbid_empty_values = true, required = true)]
|
||||
pub container_id: String,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue