Change sq packet split to write to stdout by default.

- Change `sq packet split` to not require `output` or `prefix`, but
    to write to `stdout` by default.

  - This is closer to the behavior of other commands.
This commit is contained in:
Neal H. Walfield 2024-11-19 14:27:17 +01:00
parent fdc963cd59
commit 2ba6037362
No known key found for this signature in database
GPG Key ID: 6863C9AD5B4D22D3
3 changed files with 4 additions and 4 deletions

1
NEWS
View File

@ -105,6 +105,7 @@
those that emit signed and or encrypted messages.
- The command `sq toolbox extract-cert` has been removed in favor
of `sq key delete` and `sq key subkey delete`.
- The command `sq packet split` now writes to stdout by default.
* Changes in 0.39.0
** Notable changes

View File

@ -5,7 +5,7 @@ use std::{
path::PathBuf,
};
use clap::{ArgGroup, Args, Parser, Subcommand};
use clap::{Args, Parser, Subcommand};
use crate::cli::examples::*;
use crate::cli::types::ArmorKind;
@ -263,7 +263,6 @@ The converse operation is `sq packet join`.
",
after_help = SPLIT_EXAMPLES,
)]
#[clap(group(ArgGroup::new("sink").args(&["output", "prefix"]).required(true)))]
pub struct SplitCommand {
#[clap(
default_value_t = FileOrStdin::default(),

View File

@ -134,8 +134,8 @@ pub fn split(sq: Sq, c: SplitCommand) -> Result<()>
let mut sink = match c.prefix {
Some(p) => Err(p),
None => Ok(
c.output.as_ref()
.expect("either prefix or output must be given")
c.output
.unwrap_or_default()
.create_pgp_safe(&sq, true, Kind::SecretKey)?),
};