diff options
| author | Casper Beyer <caspervonb@pm.me> | 2020-10-02 07:14:55 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-02 01:14:55 +0200 |
| commit | 4c779b5e8ca427faf24c26443a8054004827d450 (patch) | |
| tree | ddb8ded427e4987f2edbb63c1be3661569e0d204 /cli/flags.rs | |
| parent | 5590b97670206df957c43742f47601356982c658 (diff) | |
refactor(repl): use an inspector session (#7763)
This ports the REPL over to Rust and makes use of an inspector session to run a REPL on top of any isolate which lets make full use of rustylines various things like validators and completors without having to introduce a bunch of hard to test internal ops and glue code.
An accidental but good side effect of this is that the multiple line input we previously had is now an editable multi-line input prompt that is correctly stored in the history as a single entry.
Diffstat (limited to 'cli/flags.rs')
| -rw-r--r-- | cli/flags.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cli/flags.rs b/cli/flags.rs index af7bc2a08..06fbafdc3 100644 --- a/cli/flags.rs +++ b/cli/flags.rs @@ -120,6 +120,7 @@ pub struct Flags { pub no_remote: bool, pub read_allowlist: Vec<PathBuf>, pub reload: bool, + pub repl: bool, pub seed: Option<u64>, pub unstable: bool, pub v8_flags: Option<Vec<String>>, @@ -447,6 +448,7 @@ fn completions_parse(flags: &mut Flags, matches: &clap::ArgMatches) { fn repl_parse(flags: &mut Flags, matches: &clap::ArgMatches) { runtime_args_parse(flags, matches, false); + flags.repl = true; flags.subcommand = DenoSubcommand::Repl; flags.allow_net = true; flags.allow_env = true; @@ -2142,6 +2144,7 @@ mod tests { assert_eq!( r.unwrap(), Flags { + repl: true, subcommand: DenoSubcommand::Repl, allow_net: true, allow_env: true, @@ -2162,6 +2165,7 @@ mod tests { assert_eq!( r.unwrap(), Flags { + repl: true, subcommand: DenoSubcommand::Repl, unstable: true, import_map_path: Some("import_map.json".to_string()), |
