mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-25 04:54:07 +00:00
Strip mostly vestigial --verbose flag
This commit is contained in:
parent
844b20e7fc
commit
e9bc66e5e3
3 changed files with 3 additions and 15 deletions
|
|
@ -24,14 +24,8 @@ fn main() {
|
||||||
(@arg port: --port +takes_value "The port to listen on. Defaults to 8000.")
|
(@arg port: --port +takes_value "The port to listen on. Defaults to 8000.")
|
||||||
)
|
)
|
||||||
|
|
||||||
(@arg verbose: --verbose "Enable extended logging.")
|
|
||||||
).get_matches();
|
).get_matches();
|
||||||
|
|
||||||
let verbose = match matches.occurrences_of("verbose") {
|
|
||||||
0 => false,
|
|
||||||
_ => true,
|
|
||||||
};
|
|
||||||
|
|
||||||
match matches.subcommand() {
|
match matches.subcommand() {
|
||||||
("init", sub_matches) => {
|
("init", sub_matches) => {
|
||||||
let sub_matches = sub_matches.unwrap();
|
let sub_matches = sub_matches.unwrap();
|
||||||
|
|
@ -61,7 +55,7 @@ fn main() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
rojo_core::commands::serve(&project_path, verbose, port);
|
rojo_core::commands::serve(&project_path, port);
|
||||||
},
|
},
|
||||||
_ => {
|
_ => {
|
||||||
eprintln!("Please specify a subcommand!");
|
eprintln!("Please specify a subcommand!");
|
||||||
|
|
|
||||||
|
|
@ -4,16 +4,12 @@ use std::time::Instant;
|
||||||
|
|
||||||
use rand;
|
use rand;
|
||||||
|
|
||||||
use project::{Project, ProjectLoadError};
|
use project::Project;
|
||||||
use web;
|
use web;
|
||||||
|
|
||||||
pub fn serve(project_path: &PathBuf, verbose: bool, port: Option<u64>) {
|
pub fn serve(project_path: &PathBuf, port: Option<u64>) {
|
||||||
let server_id = rand::random::<u64>();
|
let server_id = rand::random::<u64>();
|
||||||
|
|
||||||
if verbose {
|
|
||||||
println!("Attempting to locate project at {}...", project_path.display());
|
|
||||||
}
|
|
||||||
|
|
||||||
let project = match Project::load(project_path) {
|
let project = match Project::load(project_path) {
|
||||||
Ok(v) => {
|
Ok(v) => {
|
||||||
println!("Using project from {}", project_path.display());
|
println!("Using project from {}", project_path.display());
|
||||||
|
|
@ -26,7 +22,6 @@ pub fn serve(project_path: &PathBuf, verbose: bool, port: Option<u64>) {
|
||||||
};
|
};
|
||||||
|
|
||||||
let web_config = web::WebConfig {
|
let web_config = web::WebConfig {
|
||||||
verbose,
|
|
||||||
port: port.unwrap_or(project.serve_port),
|
port: port.unwrap_or(project.serve_port),
|
||||||
server_id,
|
server_id,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ use web_util::json_response;
|
||||||
/// The set of configuration the web server needs to start.
|
/// The set of configuration the web server needs to start.
|
||||||
pub struct WebConfig {
|
pub struct WebConfig {
|
||||||
pub port: u64,
|
pub port: u64,
|
||||||
pub verbose: bool,
|
|
||||||
pub server_id: u64,
|
pub server_id: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue