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 }
19
19
bootc-utils = { path = " ../utils" }
20
20
clap = { workspace = true , features = [" derive" ] }
21
21
dialoguer = " 0.11.0"
22
+ indoc = { workspace = true }
22
23
log = " 0.4.21"
23
24
openssh-keys = " 0.6.4"
24
25
rustix = { 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
6
6
you may not be able to log in after reinstalling. Do you want to continue?";
7
7
8
8
fn 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
+ } ;
16
16
let answer = ask_yes_no ( & prompt, true ) ?;
17
17
Ok ( if answer { vec ! [ & user] } else { vec ! [ ] } )
18
18
}
@@ -24,10 +24,10 @@ fn prompt_user_selection(
24
24
25
25
// TODO: Handle https://github.com/console-rs/dialoguer/issues/77
26
26
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
29
29
import into the root user of the new bootc system" ,
30
- )
30
+ } )
31
31
. items ( & keys)
32
32
. interact ( ) ?;
33
33
You can’t perform that action at this time.
0 commit comments