Skip to content

Commit

Permalink
fix: test output for completions (denoland#2597)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju authored and ry committed Jun 29, 2019
1 parent 38cf346 commit 5a4bebb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cli/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use clap::SubCommand;
use crate::deno_dir;
use log::Level;
use std;
use std::str;
use std::str::FromStr;

// Creates vector of strings, Vec<String>
Expand Down Expand Up @@ -671,11 +672,13 @@ pub fn flags_from_vec(
}
("completions", Some(completions_match)) => {
let shell: &str = completions_match.value_of("shell").unwrap();
let mut buf: Vec<u8> = vec![];
create_cli_app().gen_completions_to(
"deno",
Shell::from_str(shell).unwrap(),
&mut std::io::stdout(),
&mut buf,
);
print!("{}", std::str::from_utf8(&buf).unwrap());
DenoSubcommand::Completions
}
("eval", Some(eval_match)) => {
Expand Down

0 comments on commit 5a4bebb

Please sign in to comment.