diff options
Diffstat (limited to 'runtime/permissions')
-rw-r--r-- | runtime/permissions/prompter.rs | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/runtime/permissions/prompter.rs b/runtime/permissions/prompter.rs index 59a3a2f7b..050902d59 100644 --- a/runtime/permissions/prompter.rs +++ b/runtime/permissions/prompter.rs @@ -319,16 +319,29 @@ impl PermissionPrompter for TtyPrompter { // output everything in one shot to make the tests more reliable { let mut output = String::new(); - write!(&mut output, "┌ {PERMISSION_EMOJI} ").unwrap(); + write!(&mut output, "┏ {PERMISSION_EMOJI} ").unwrap(); write!(&mut output, "{}", colors::bold("Deno requests ")).unwrap(); write!(&mut output, "{}", colors::bold(message.clone())).unwrap(); writeln!(&mut output, "{}", colors::bold(".")).unwrap(); if let Some(api_name) = api_name.clone() { - writeln!(&mut output, "├ Requested by `{api_name}` API.").unwrap(); + writeln!( + &mut output, + "┠─ Requested by `{}` API.", + colors::bold(api_name) + ) + .unwrap(); } + let msg = format!( + "Learn more at: {}", + colors::cyan_with_underline(&format!( + "https://docs.deno.com/go/--allow-{}", + name + )) + ); + writeln!(&mut output, "┠─ {}", colors::italic(&msg)).unwrap(); let msg = format!("Run again with --allow-{name} to bypass this prompt."); - writeln!(&mut output, "├ {}", colors::italic(&msg)).unwrap(); - write!(&mut output, "└ {}", colors::bold("Allow?")).unwrap(); + writeln!(&mut output, "┠─ {}", colors::italic(&msg)).unwrap(); + write!(&mut output, "┗ {}", colors::bold("Allow?")).unwrap(); write!(&mut output, " {opts} > ").unwrap(); stderr_lock.write_all(output.as_bytes()).unwrap(); @@ -355,7 +368,7 @@ impl PermissionPrompter for TtyPrompter { 'y' | 'Y' => { clear_n_lines( &mut stderr_lock, - if api_name.is_some() { 4 } else { 3 }, + if api_name.is_some() { 5 } else { 4 }, ); let msg = format!("Granted {message}."); writeln!(stderr_lock, "✅ {}", colors::bold(&msg)).unwrap(); @@ -364,7 +377,7 @@ impl PermissionPrompter for TtyPrompter { 'n' | 'N' | '\x1b' => { clear_n_lines( &mut stderr_lock, - if api_name.is_some() { 4 } else { 3 }, + if api_name.is_some() { 5 } else { 4 }, ); let msg = format!("Denied {message}."); writeln!(stderr_lock, "❌ {}", colors::bold(&msg)).unwrap(); @@ -373,7 +386,7 @@ impl PermissionPrompter for TtyPrompter { 'A' if is_unary => { clear_n_lines( &mut stderr_lock, - if api_name.is_some() { 4 } else { 3 }, + if api_name.is_some() { 5 } else { 4 }, ); let msg = format!("Granted all {name} access."); writeln!(stderr_lock, "✅ {}", colors::bold(&msg)).unwrap(); @@ -384,7 +397,7 @@ impl PermissionPrompter for TtyPrompter { clear_n_lines(&mut stderr_lock, 1); write!( stderr_lock, - "└ {} {opts} > ", + "┗ {} {opts} > ", colors::bold("Unrecognized option. Allow?") ) .unwrap(); |