Skip to content

Commit

Permalink
feat(efiboot): update clap to version 4
Browse files Browse the repository at this point in the history
  • Loading branch information
iTrooz committed Oct 18, 2023
1 parent 29022c7 commit 155b44d
Show file tree
Hide file tree
Showing 9 changed files with 147 additions and 169 deletions.
198 changes: 88 additions & 110 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion efiboot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ edition = "2018"

[dependencies]
byteorder = "1.4.3"
clap = { version = "4.4.6", features = ["derive", "env"] }
efivar = { version = "1.4.0", path = "../efivar", features = ["store"] }
itertools = "0.11.0"
structopt = { version = "0.3.26" }
uuid = { version = "1.4.1" }

[dev-dependencies]
Expand Down
28 changes: 15 additions & 13 deletions efiboot/src/cli/boot/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::exit_code::ExitCode;

use clap::Parser;
use efivar::VarManager;
use structopt::StructOpt;

use crate::id::BootEntryId;

Expand All @@ -16,58 +16,60 @@ pub mod order;
#[cfg(test)]
pub mod tests;

#[derive(StructOpt)]
#[derive(Parser)]
pub enum BootCommand {
/// Get all boot entries found, both in the boot order, and outside it if the name matchs
GetEntries {
/// Show more information, such as optional data
#[structopt(short, long)]
#[arg(short, long)]
verbose: bool,
},
Add {
/// Partition that holds the file to boot from. Defaults to the currently active boot partition
#[structopt(short, long)]
#[arg(short, long)]
partition: Option<String>,

/// File to boot from, inside the partition
#[structopt(short, long)]
#[arg(short, long)]
file: String,

/// Set entry description
#[structopt(short, long)]
#[arg(short, long)]
description: String,

/// Skip checks to ensure data is valid
#[structopt(long)]
#[arg(long)]
force: bool,

/// ID to give to the boot entry
#[structopt(long)]
#[arg(long)]
id: Option<BootEntryId>,
},
/// Delete boot entry
#[structopt(visible_alias = "del")]
#[structopt(visible_alias = "remove")]
#[command(alias = "del")]
#[command(alias = "remove")]
Delete {
/// ID of the boot entry to delete
#[structopt()]
#[arg()]
id: BootEntryId,
},
/// Enable boot entry
Enable {
/// ID of the boot entry to enable
#[structopt()]
#[arg()]
id: BootEntryId,
},
/// Disable boot entry
Disable {
/// ID of the boot entry to disable
#[structopt()]
#[arg()]
id: BootEntryId,
},
/// Manage boot order
#[command(subcommand)]
Order(OrderCommand),
/// Manage BootNext variable
#[command(subcommand)]
Next(BootNextCommand),
}

Expand Down
Loading

0 comments on commit 155b44d

Please sign in to comment.