File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed
Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ anyhow = { workspace = true }
1919bootc-utils = { path = " ../utils" }
2020clap = { workspace = true , features = [" derive" ] }
2121dialoguer = " 0.11.0"
22+ indoc = { workspace = true }
2223log = " 0.4.21"
2324openssh-keys = " 0.6.4"
2425rustix = { workspace = true }
Original file line number Diff line number Diff line change @@ -6,13 +6,13 @@ const NO_SSH_PROMPT: &str = "None of the users on this system found have authori
66 you may not be able to log in after reinstalling. Do you want to continue?";
77
88fn prompt_single_user ( user : & crate :: users:: UserKeys ) -> Result < Vec < & crate :: users:: UserKeys > > {
9- let prompt = format ! (
10- "Found only one user ({}) with {} SSH authorized keys.\n \
11- Would you like to import its SSH authorized keys\n \
12- into the root user on the new bootc system?",
13- user. user,
14- user. num_keys( ) ,
15- ) ;
9+ let prompt = indoc :: formatdoc! {
10+ "Found only one user ({user }) with {num_keys } SSH authorized keys.
11+ Would you like to import its SSH authorized keys
12+ into the root user on the new bootc system?" ,
13+ user = user . user,
14+ num_keys = user. num_keys( ) ,
15+ } ;
1616 let answer = ask_yes_no ( & prompt, true ) ?;
1717 Ok ( if answer { vec ! [ & user] } else { vec ! [ ] } )
1818}
@@ -24,10 +24,10 @@ fn prompt_user_selection(
2424
2525 // TODO: Handle https://github.com/console-rs/dialoguer/issues/77
2626 let selected_user_indices: Vec < usize > = dialoguer:: MultiSelect :: new ( )
27- . with_prompt (
28- "Select which user's SSH authorized keys you want to\n \
27+ . with_prompt ( indoc :: indoc! {
28+ "Select which user's SSH authorized keys you want to
2929 import into the root user of the new bootc system" ,
30- )
30+ } )
3131 . items ( & keys)
3232 . interact ( ) ?;
3333
You can’t perform that action at this time.
0 commit comments