-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
178 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
mod clean; | ||
pub mod config; | ||
mod info; | ||
mod install; | ||
mod list; | ||
mod meta; | ||
mod mirror; | ||
mod pack; | ||
mod uninstall; | ||
mod update; | ||
mod utils; | ||
mod verify; | ||
|
||
pub use self::clean::clean; | ||
pub use self::info::{info, info_local}; | ||
pub use self::install::install_using_package; | ||
pub use self::list::list; | ||
pub use self::meta::meta; | ||
pub use self::pack::pack; | ||
pub use self::uninstall::uninstall; | ||
pub use self::update::update_using_package; | ||
mod clean; | ||
pub mod config; | ||
mod info; | ||
mod install; | ||
mod list; | ||
mod meta; | ||
mod mirror; | ||
mod pack; | ||
mod uninstall; | ||
mod update; | ||
mod utils; | ||
mod verify; | ||
|
||
pub use self::clean::clean; | ||
pub use self::info::{info, info_local}; | ||
pub use self::install::install_using_package; | ||
pub use self::list::list; | ||
pub use self::meta::meta; | ||
pub use self::mirror::{mirror_add, mirror_remove, mirror_update, mirror_update_all}; | ||
pub use self::pack::pack; | ||
pub use self::uninstall::uninstall; | ||
pub use self::update::update_using_package; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use clap::Subcommand; | ||
|
||
#[derive(Subcommand, Debug)] | ||
pub enum ActionMirror { | ||
/// Add mirror | ||
Add { | ||
/// Mirror url | ||
url: String, | ||
}, | ||
/// Update mirror index | ||
Update { | ||
/// (Optional) Mirror name, update all if not provided | ||
name: Option<String>, | ||
}, | ||
/// Remove mirror | ||
Remove { | ||
/// Mirror name | ||
name: String, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,94 @@ | ||
mod config; | ||
|
||
pub use self::config::ActionConfig; | ||
use clap::{Parser, Subcommand}; | ||
|
||
/// [Alpha] Edgeless Package Tool (ept) for Edgeless Next-Generation Packages (nep) | ||
#[derive(Parser, Debug)] | ||
#[command(version)] | ||
pub struct Args { | ||
#[command(subcommand)] | ||
pub action: Action, | ||
/// Confirm each "Yes or No" question | ||
#[arg(short, long)] | ||
pub yes: bool, | ||
|
||
/// Strict mode, throw immediately when a workflow step goes wrong | ||
#[arg(short, long)] | ||
pub strict: bool, | ||
|
||
/// (Dangerous) Disable online Edgeless CA to skip signature signing or verifying | ||
#[arg(long)] | ||
pub offline: bool, | ||
|
||
/// Tweaking certain behavior when running in Edgeless QA | ||
#[arg(long)] | ||
pub qa: bool, | ||
|
||
/// Run commands in debug mode | ||
#[arg(short, long)] | ||
pub debug: bool, | ||
// TODO:支持日志写入文件,并检查 println! | ||
} | ||
|
||
#[derive(Subcommand, Debug)] | ||
pub enum Action { | ||
/// Install a package with path (locally in current version) | ||
Install { | ||
/// Package path (or package name in future versions) | ||
package: String, | ||
}, | ||
|
||
/// Update a package with path (locally in current version) | ||
Update { | ||
/// Package path (or package name in future versions) | ||
package: String, | ||
}, | ||
|
||
/// Uninstall a package with package name | ||
Uninstall { | ||
/// Package name | ||
package_name: String, | ||
}, | ||
|
||
/// Pack a directory content into nep | ||
Pack { | ||
/// Source directory ready to be packed | ||
source_dir: String, | ||
/// (Optional) Store packed nep at | ||
into_file: Option<String>, | ||
}, | ||
|
||
/// Query package information (locally in current version) | ||
Info { | ||
/// Package name | ||
package_name: String, | ||
}, | ||
|
||
/// List information of installed packages | ||
List, | ||
|
||
/// Get meta data of given package | ||
Meta { | ||
/// Source package | ||
source_package: String, | ||
/// (Optional) Save meta report at | ||
save_at: Option<String>, | ||
}, | ||
|
||
/// Clean temporary or illegal files | ||
Clean, | ||
|
||
/// Manage ept config files | ||
Config { | ||
#[command(subcommand)] | ||
operation: ActionConfig, | ||
}, | ||
} | ||
mod config; | ||
mod mirror; | ||
pub use self::config::ActionConfig; | ||
pub use self::mirror::ActionMirror; | ||
use clap::{Parser, Subcommand}; | ||
|
||
/// [Alpha] Edgeless Package Tool (ept) for Edgeless Next-Generation Packages (nep) | ||
#[derive(Parser, Debug)] | ||
#[command(version)] | ||
pub struct Args { | ||
#[command(subcommand)] | ||
pub action: Action, | ||
/// Confirm each "Yes or No" question | ||
#[arg(short, long)] | ||
pub yes: bool, | ||
|
||
/// Strict mode, throw immediately when a workflow step goes wrong | ||
#[arg(short, long)] | ||
pub strict: bool, | ||
|
||
/// (Dangerous) Disable online Edgeless CA to skip signature signing or verifying | ||
#[arg(long)] | ||
pub offline: bool, | ||
|
||
/// Tweaking certain behavior when running in Edgeless QA | ||
#[arg(long)] | ||
pub qa: bool, | ||
|
||
/// Run commands in debug mode | ||
#[arg(short, long)] | ||
pub debug: bool, | ||
// TODO:支持日志写入文件,并检查 println! | ||
} | ||
|
||
#[derive(Subcommand, Debug)] | ||
pub enum Action { | ||
/// Install a package with path (locally in current version) | ||
Install { | ||
/// Package path (or package name in future versions) | ||
package: String, | ||
}, | ||
|
||
/// Update a package with path (locally in current version) | ||
Update { | ||
/// Package path (or package name in future versions) | ||
package: String, | ||
}, | ||
|
||
/// Uninstall a package with package name | ||
Uninstall { | ||
/// Package name | ||
package_name: String, | ||
}, | ||
|
||
/// Pack a directory content into nep | ||
Pack { | ||
/// Source directory ready to be packed | ||
source_dir: String, | ||
/// (Optional) Store packed nep at | ||
into_file: Option<String>, | ||
}, | ||
|
||
/// Query package information (locally in current version) | ||
Info { | ||
/// Package name | ||
package_name: String, | ||
}, | ||
|
||
/// List information of installed packages | ||
List, | ||
|
||
/// Get meta data of given package | ||
Meta { | ||
/// Source package | ||
source_package: String, | ||
/// (Optional) Save meta report at | ||
save_at: Option<String>, | ||
}, | ||
|
||
/// Clean temporary or illegal files | ||
Clean, | ||
|
||
/// Manage ept config | ||
Config { | ||
#[command(subcommand)] | ||
operation: ActionConfig, | ||
}, | ||
|
||
/// Manage nep mirrors | ||
Mirror { | ||
#[command(subcommand)] | ||
operation: ActionMirror, | ||
}, | ||
} |