feat: add verbose flag
This commit is contained in:
1 parent
d20e7ab508
commit
421d2ed298
5 files changed
+27
-1
No files matched your search
@@ -48,6 +48,9 @@ pub fn build(config: &CrateConfig) -> Result<()> {
|
|||||||
if config.release {
|
if config.release {
|
||||||
cmd.arg("--release");
|
cmd.arg("--release");
|
||||||
}
|
}
|
||||||
|
if config.verbose {
|
||||||
|
cmd.arg("--verbose");
|
||||||
|
}
|
||||||
|
|
||||||
if config.custom_profile.is_some() {
|
if config.custom_profile.is_some() {
|
||||||
let custom_profile = config.custom_profile.as_ref().unwrap();
|
let custom_profile = config.custom_profile.as_ref().unwrap();
|
||||||
@@ -200,6 +203,9 @@ pub fn build_desktop(config: &CrateConfig, is_serve: bool) -> Result<()> {
|
|||||||
if config.release {
|
if config.release {
|
||||||
cmd.arg("--release");
|
cmd.arg("--release");
|
||||||
}
|
}
|
||||||
|
if config.verbose {
|
||||||
|
cmd.arg("--verbose");
|
||||||
|
}
|
||||||
|
|
||||||
if config.custom_profile.is_some() {
|
if config.custom_profile.is_some() {
|
||||||
let custom_profile = config.custom_profile.as_ref().unwrap();
|
let custom_profile = config.custom_profile.as_ref().unwrap();
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ impl Build {
|
|||||||
|
|
||||||
// change the release state.
|
// change the release state.
|
||||||
crate_config.with_release(self.build.release);
|
crate_config.with_release(self.build.release);
|
||||||
|
crate_config.with_verbose(self.build.verbose);
|
||||||
|
|
||||||
if self.build.example.is_some() {
|
if self.build.example.is_some() {
|
||||||
crate_config.as_example(self.build.example.unwrap());
|
crate_config.as_example(self.build.example.unwrap());
|
||||||
|
|||||||
@@ -12,6 +12,11 @@ pub struct ConfigOptsBuild {
|
|||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub release: bool,
|
pub release: bool,
|
||||||
|
|
||||||
|
// Use verbose output [default: false]
|
||||||
|
#[clap(long)]
|
||||||
|
#[serde(default)]
|
||||||
|
pub verbose: bool,
|
||||||
|
|
||||||
/// Build a example [default: ""]
|
/// Build a example [default: ""]
|
||||||
#[clap(long)]
|
#[clap(long)]
|
||||||
pub example: Option<String>,
|
pub example: Option<String>,
|
||||||
@@ -44,6 +49,11 @@ pub struct ConfigOptsServe {
|
|||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub release: bool,
|
pub release: bool,
|
||||||
|
|
||||||
|
// Use verbose output [default: false]
|
||||||
|
#[clap(long)]
|
||||||
|
#[serde(default)]
|
||||||
|
pub verbose: bool,
|
||||||
|
|
||||||
/// Build with custom profile
|
/// Build with custom profile
|
||||||
#[clap(long)]
|
#[clap(long)]
|
||||||
pub profile: Option<String>,
|
pub profile: Option<String>,
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ impl Serve {
|
|||||||
|
|
||||||
// change the relase state.
|
// change the relase state.
|
||||||
crate_config.with_release(self.serve.release);
|
crate_config.with_release(self.serve.release);
|
||||||
|
crate_config.with_verbose(self.serve.verbose);
|
||||||
|
|
||||||
if self.serve.example.is_some() {
|
if self.serve.example.is_some() {
|
||||||
crate_config.as_example(self.serve.example.unwrap());
|
crate_config.as_example(self.serve.example.unwrap());
|
||||||
|
|||||||
+9
-1
@@ -114,6 +114,7 @@ pub struct CrateConfig {
|
|||||||
pub executable: ExecutableType,
|
pub executable: ExecutableType,
|
||||||
pub dioxus_config: DioxusConfig,
|
pub dioxus_config: DioxusConfig,
|
||||||
pub release: bool,
|
pub release: bool,
|
||||||
|
pub verbose: bool,
|
||||||
pub custom_profile: Option<String>,
|
pub custom_profile: Option<String>,
|
||||||
pub features: Option<Vec<String>>,
|
pub features: Option<Vec<String>>,
|
||||||
}
|
}
|
||||||
@@ -164,6 +165,7 @@ impl CrateConfig {
|
|||||||
let executable = ExecutableType::Binary(output_filename);
|
let executable = ExecutableType::Binary(output_filename);
|
||||||
|
|
||||||
let release = false;
|
let release = false;
|
||||||
|
let verbose = false;
|
||||||
let custom_profile = None;
|
let custom_profile = None;
|
||||||
let features = None;
|
let features = None;
|
||||||
|
|
||||||
@@ -178,7 +180,8 @@ impl CrateConfig {
|
|||||||
release,
|
release,
|
||||||
dioxus_config,
|
dioxus_config,
|
||||||
custom_profile,
|
custom_profile,
|
||||||
features
|
features,
|
||||||
|
verbose,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,6 +195,11 @@ impl CrateConfig {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn with_verbose(&mut self, verbose: bool) -> &mut Self {
|
||||||
|
self.verbose = verbose;
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
pub fn set_profile(&mut self, profile: String) -> &mut Self {
|
pub fn set_profile(&mut self, profile: String) -> &mut Self {
|
||||||
self.custom_profile = Some(profile);
|
self.custom_profile = Some(profile);
|
||||||
self
|
self
|
||||||
|
|||||||
Reference in new issue
Block a user