Skip to content

Commit

Permalink
remove no longer needed DenoFlags fields
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju committed Apr 20, 2019
1 parent bcd31fa commit 6e2f8d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
12 changes: 0 additions & 12 deletions cli/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ pub struct DenoFlags {
pub no_prompts: bool,
pub types: bool,
pub prefetch: bool,
pub info: bool,
pub fmt: bool,
pub eval: bool,
}

impl<'a> From<ArgMatches<'a>> for DenoFlags {
Expand Down Expand Up @@ -77,15 +74,6 @@ impl<'a> From<ArgMatches<'a>> for DenoFlags {
if matches.is_present("prefetch") {
flags.prefetch = true;
}
if matches.is_present("info") {
flags.info = true;
}
if matches.is_present("fmt") {
flags.fmt = true;
}
if matches.is_present("eval") {
flags.eval = true;
}

flags
}
Expand Down
13 changes: 4 additions & 9 deletions cli/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ fn get_worker_and_state(
}

fn info_command(flags: DenoFlags, argv: Vec<String>) {
let should_display_info = flags.info;
// TODO(bartlomieju) legacy, to be removed
let should_display_info = true;
let (mut worker, state) = get_worker_and_state(flags, argv);

if let Some(main_module) = state.main_module() {
Expand All @@ -151,7 +152,7 @@ fn info_command(flags: DenoFlags, argv: Vec<String>) {
let main_url = root_specifier_to_url(&main_module).unwrap();

worker
.execute_mod_async(&main_url, true)
.execute_mod_async(&main_url, should_display_info)
.and_then(move |worker| {
if should_display_info {
// Display file info and exit. Do not run file
Expand Down Expand Up @@ -214,8 +215,7 @@ fn run_repl(flags: DenoFlags, argv: Vec<String>) {
}

fn run_script(flags: DenoFlags, argv: Vec<String>) {
let should_prefetch = flags.prefetch || flags.info;
let should_display_info = flags.info;
let should_prefetch = flags.prefetch;

let (mut worker, state) = get_worker_and_state(flags, argv);

Expand All @@ -232,11 +232,6 @@ fn run_script(flags: DenoFlags, argv: Vec<String>) {
worker
.execute_mod_async(&main_url, should_prefetch)
.and_then(move |worker| {
if should_display_info {
// Display file info and exit. Do not run file
print_file_info(&worker, &main_module);
std::process::exit(0);
}
worker.then(|result| {
js_check(result);
Ok(())
Expand Down

0 comments on commit 6e2f8d9

Please sign in to comment.