summaryrefslogtreecommitdiff
path: root/cli/flags.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/flags.rs')
-rw-r--r--cli/flags.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/cli/flags.rs b/cli/flags.rs
index bcc04d94d..b78dc646a 100644
--- a/cli/flags.rs
+++ b/cli/flags.rs
@@ -381,6 +381,7 @@ fn bundle_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
config_arg_parse(flags, matches);
importmap_arg_parse(flags, matches);
unstable_arg_parse(flags, matches);
+ lock_args_parse(flags, matches);
let source_file = matches.value_of("source_file").unwrap().to_string();
@@ -720,6 +721,8 @@ These must be added to the path manually if required.")
fn bundle_subcommand<'a, 'b>() -> App<'a, 'b> {
SubCommand::with_name("bundle")
+ .arg(lock_arg())
+ .arg(lock_write_arg())
.arg(
Arg::with_name("source_file")
.takes_value(true)
@@ -2110,6 +2113,29 @@ mod tests {
}
#[test]
+ fn bundle_with_lock() {
+ let r = flags_from_vec_safe(svec![
+ "deno",
+ "bundle",
+ "--lock-write",
+ "--lock=lock.json",
+ "source.ts"
+ ]);
+ assert_eq!(
+ r.unwrap(),
+ Flags {
+ subcommand: DenoSubcommand::Bundle {
+ source_file: "source.ts".to_string(),
+ out_file: None,
+ },
+ lock_write: true,
+ lock: Some("lock.json".to_string()),
+ ..Flags::default()
+ }
+ );
+ }
+
+ #[test]
fn run_importmap() {
let r = flags_from_vec_safe(svec![
"deno",