Skip to content

Commit

Permalink
feat: ✨ CLI新增 --quick-start 开关参数,以在「配置明了」的情况下快速启动CIN
Browse files Browse the repository at this point in the history
  • Loading branch information
ARCJ137442 committed Sep 13, 2024
1 parent c3abea9 commit 69ff174
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "babel_nar_cli"
version = "0.2.1"
version = "0.3.0"
edition = "2021"
description = """
Command Line Interface (CLI) of BabelNAR.rs
Expand Down
9 changes: 9 additions & 0 deletions src/cli/arg_parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,18 @@ pub struct CliArgs {
// * 📌行为
// * 没有 ⇒ `false`
// * 有  ⇒ `true`
// * 📄参考[`DEFAULT_CONFIG_KEYWORD`]
/// Disable the default configuration file in the same directory as exe
#[arg(short, long)]
pub disable_default: bool,

// 快速启动
// * 消除在「成功加载配置」之后的延迟时间,并快速启动CIN
// * 🎯在明确「所加载的配置」时,快速启动虚拟机并进入终端
// * 📄直接跳过「配置加载完毕!程序将在1s后启动。。。」
/// Launch the virtual machine immediately without delay after loading the configuration
#[arg(long)]
pub quick_start: bool,
// ! 🚩【2024-04-02 11:36:18】目前除了「配置加载」外,莫将任何「NAVM实现特定,可以内置到『虚拟机配置』的字段放这儿」
}

Expand Down
2 changes: 1 addition & 1 deletion src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub fn main_args(cwd: IoResult<PathBuf>, args: impl Iterator<Item = String>) ->
polyfill_config_from_user(&mut config, cwd);

// 清屏,预备启动
if user_verbose {
if !args.quick_start && user_verbose {
println_cli!([Info] "配置加载完毕!程序将在1s后启动。。。");
sleep(Duration::from_secs(1));
}
Expand Down

0 comments on commit 69ff174

Please sign in to comment.