edit in pijul/src/main.rs at line 11
+ use pijul_interaction::InteractiveContext;
edit in pijul/src/main.rs at line 22
+ /// Abort rather than prompt for input
+ #[clap(long, global = true)]
+ pub no_prompt: bool,
edit in pijul/src/main.rs at line 155
− pijul_interaction::set_context(pijul_interaction::InteractiveContext::Terminal);
edit in pijul/src/main.rs at line 160
edit in pijul/src/main.rs at line 162
+ if opts.no_prompt {
+ pijul_interaction::set_context(InteractiveContext::NotInteractive);
+ } else {
+ pijul_interaction::set_context(InteractiveContext::Terminal);
+ }
replacement in pijul/src/identity/repair.rs at line 42
[4.3347]→[4.3347:3509](∅→∅) − ///
− /// # Arguments
− /// * `no_prompt` - If the user should not be prompted for input.
− pub async fn fix_identities(no_prompt: bool) -> Result<(), anyhow::Error> {
+ pub async fn fix_identities() -> Result<(), anyhow::Error> {
replacement in pijul/src/identity/repair.rs at line 63
− old_identity.clone().create(no_prompt, true).await?;
+ old_identity.clone().create(true).await?;
edit in pijul/src/identity/repair.rs at line 88
[4.6056]→[4.6056:6185](∅→∅) − if no_prompt {
− bail!("No identities configured");
− }
−
replacement in pijul/src/identity/repair.rs at line 89
[4.6256]→[4.6256:6333](∅→∅) − Complete::default()?.create(no_prompt, true).await?;
+ Complete::default()?.create(true).await?;
edit in pijul/src/identity/load.rs at line 66
[4.24405]→[4.24405:24491](∅→∅) − /// # Arguments
− /// * `no_prompt` - If the user should not be prompted for input.
− ///
replacement in pijul/src/identity/load.rs at line 68
[4.24577]→[4.24577:24663](∅→∅) − pub async fn choose_identity_name(no_prompt: bool) -> Result<String, anyhow::Error> {
+ pub async fn choose_identity_name() -> Result<String, anyhow::Error> {
replacement in pijul/src/identity/load.rs at line 75
[4.24848]→[4.24848:24890](∅→∅) − fix_identities(no_prompt).await?;
+ fix_identities().await?;
edit in pijul/src/identity/load.rs at line 81
[4.25052]→[4.25052:25155](∅→∅) − } else if no_prompt {
− bail!("Cannot prompt user to choose identity (--no-prompt is set)");
edit in pijul/src/identity/create.rs at line 268
[4.38371]→[4.38371:38441](∅→∅) − /// * `no_prompt` - If the user should not be prompted for input.
replacement in pijul/src/identity/create.rs at line 269
[4.38529]→[4.1720:1818](∅→∅) − pub async fn create(&self, no_prompt: bool, link_remote: bool) -> Result<(), anyhow::Error> {
+ pub async fn create(&self, link_remote: bool) -> Result<(), anyhow::Error> {
replacement in pijul/src/identity/create.rs at line 271
[4.14076]→[4.38665:38713](∅→∅),
[4.38665]→[4.38665:38713](∅→∅),
[4.38713]→[4.14077:14102](∅→∅),
[4.14102]→[4.38730:38747](∅→∅),
[4.38730]→[4.38730:38747](∅→∅),
[4.38747]→[4.966:1024](∅→∅),
[4.1024]→[4.38787:38799](∅→∅),
[4.14162]→[4.38787:38799](∅→∅),
[4.38787]→[4.38787:38799](∅→∅) − let confirmed_identity = if no_prompt {
− self.clone()
− } else {
− self.prompt_changes(None, link_remote).await?
− };
−
+ let confirmed_identity = self.prompt_changes(None, link_remote).await?;
replacement in pijul/src/commands/tag.rs at line 281
[4.788]→[4.229:329](∅→∅),
[4.229]→[4.229:329](∅→∅) − let k = crate::identity::public_key(&crate::identity::choose_identity_name(false).await?)?;
+ let k = crate::identity::public_key(&crate::identity::choose_identity_name().await?)?;
replacement in pijul/src/commands/record.rs at line 153
[4.15216]→[4.15216:15315](∅→∅) − crate::identity::Complete::load(&crate::identity::choose_identity_name(false).await?)?
+ crate::identity::Complete::load(&crate::identity::choose_identity_name().await?)?
replacement in pijul/src/commands/record.rs at line 227
[4.953]→[4.953:1038](∅→∅) − .unwrap_or(crate::identity::choose_identity_name(false).await?),
+ .unwrap_or(crate::identity::choose_identity_name().await?),
replacement in pijul/src/commands/identity.rs at line 156
[4.46167]→[4.46167:46295](∅→∅) − Repair {
− /// Abort rather than prompt for input
− #[clap(long = "no-prompt")]
− no_prompt: bool,
− },
edit in pijul/src/commands/identity.rs at line 164
[4.4441]→[4.46469:46577](∅→∅),
[4.46469]→[4.46469:46577](∅→∅) − /// Abort rather than prompt for input
− #[clap(long = "no-prompt")]
− no_prompt: bool,
replacement in pijul/src/commands/identity.rs at line 252
[4.49307]→[4.49307:49384](∅→∅) − identity.create(options.no_prompt, !options.no_link).await?;
+ identity.create(!options.no_link).await?;
replacement in pijul/src/commands/identity.rs at line 260
[4.49398]→[4.49398:49480](∅→∅) − SubCommand::Repair { no_prompt } => fix_identities(no_prompt).await?,
+ SubCommand::Repair => fix_identities().await?,
edit in pijul/src/commands/identity.rs at line 264
[4.4466]→[4.49543:49570](∅→∅),
[4.49543]→[4.49543:49570](∅→∅) replacement in pijul/src/commands/identity.rs at line 265
[4.49589]→[3.2534:2656](∅→∅) − let identity_name =
− &identity_name.unwrap_or(choose_identity_name(no_prompt).await?);
+ let identity_name = &identity_name.unwrap_or(choose_identity_name().await?);
replacement in pijul/src/commands/identity.rs at line 376
[4.54509]→[4.54509:54576](∅→∅) − choose_identity_name(options.no_prompt).await?
+ choose_identity_name().await?
replacement in pijul/src/commands/identity.rs at line 430
[2.176]→[4.55866:56019](∅→∅),
[4.55866]→[4.55866:56019](∅→∅) − let identity = Complete::load(
− &identity_name.unwrap_or(choose_identity_name(no_prompt).await?),
− )?;
+ let identity =
+ Complete::load(&identity_name.unwrap_or(choose_identity_name().await?))?;