diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-02-01 18:29:00 -0500 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-02-02 17:48:43 -0500 |
commit | 18b815e33627865b8f4d13f29e2e6e4dc7670f1d (patch) | |
tree | 7ee1b9af60fa161ef4356ae28ecf7e2c94a5cb0e /src/flags.rs | |
parent | f84da880bb5bd8fadd7c884ecfeb48aa5b7b9c08 (diff) |
Support --fmt
Diffstat (limited to 'src/flags.rs')
-rw-r--r-- | src/flags.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/flags.rs b/src/flags.rs index ecc60922e..d68bb5e09 100644 --- a/src/flags.rs +++ b/src/flags.rs @@ -30,6 +30,7 @@ pub struct DenoFlags { pub types: bool, pub prefetch: bool, pub info: bool, + pub fmt: bool, } pub fn get_usage(opts: &Options) -> String { @@ -115,6 +116,9 @@ fn set_recognized_flags( if matches.opt_present("info") { flags.info = true; } + if matches.opt_present("fmt") { + flags.fmt = true; + } if !matches.free.is_empty() { rest.extend(matches.free); @@ -152,6 +156,7 @@ pub fn set_flags( opts.optflag("", "types", "Print runtime TypeScript declarations."); opts.optflag("", "prefetch", "Prefetch the dependencies."); opts.optflag("", "info", "Show source file related info"); + opts.optflag("", "fmt", "Format code."); let mut flags = DenoFlags::default(); |