use clap::{ambient_authority, TryFromOsArg};
use nameless::{InputByteStream, OutputByteStream};
use std::io::copy;
#[kommand::main]
fn main(input: Option<InputByteStream>, output: Option<OutputByteStream>) -> anyhow::Result<()> {
let mut input = if let Some(input) = input {
input
} else {
InputByteStream::try_from_os_str_arg("-".as_ref(), ambient_authority())?
};
let mut output = if let Some(output) = output {
output
} else {
OutputByteStream::try_from_os_str_arg("-".as_ref(), ambient_authority())?
};
copy(&mut input, &mut output)?;
Ok(())
}