Skip to content

Commit

Permalink
chore: Small fixups in the CLI code. (#136)
Browse files Browse the repository at this point in the history
This commit just makes some small fixes in the CLI code, nothing
impacting behavior at all.

Signed-off-by: Andrew Lilley Brinker <alilleybrinker@gmail.com>
  • Loading branch information
alilleybrinker authored Mar 1, 2024
1 parent e4fcdaa commit 893cd89
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion omnibor/src/bin/omnibor/find.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use tokio::sync::mpsc::Sender;
pub async fn run(tx: &Sender<PrinterCmd>, args: &FindArgs) -> Result<()> {
let FindArgs { url, path, format } = args;

// TODO(alilleybrinker): Correctly handle possible future hash formats.
let id = ArtifactId::<Sha256>::id_url(url.clone())?;
let url = id.url();

Expand All @@ -24,7 +25,7 @@ pub async fn run(tx: &Sender<PrinterCmd>, args: &FindArgs) -> Result<()> {
loop {
match entries.next().await {
None => break,
Some(Err(e)) => tx.send(PrinterCmd::Message(Msg::error(e, *format))).await?,
Some(Err(e)) => tx.send(PrinterCmd::error(e, *format)).await?,
Some(Ok(entry)) => {
let path = &entry.path();

Expand Down
2 changes: 1 addition & 1 deletion omnibor/src/bin/omnibor/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async fn main() -> ExitCode {
exit_code
}

/// Select and run the chosen chosen.
/// Select and run the chosen command.
async fn run(tx: &Sender<PrinterCmd>, cmd: &Command) -> Result<()> {
match cmd {
Command::Id(ref args) => id::run(tx, args).await,
Expand Down
3 changes: 3 additions & 0 deletions omnibor/src/bin/omnibor/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ impl Printer {
/// A print queue message, either an actual message or a signals to end printing.
#[derive(Debug, Clone)]
pub enum PrinterCmd {
/// Shut down the printer task.
End,

/// Print the following message.
Message(Msg),
}

Expand Down

0 comments on commit 893cd89

Please sign in to comment.