AttachmentListCommand (attachment/list.rs)

himalaya · src/shared/attachment/list.rs · rust · Apache-2.0
email, tag:knn-classified

Rust command that lists email message attachments in a table, supporting inline filtering and color styling.

// Source: https://github.com/pimalaya/himalaya | License: Apache-2.0 | Copyright 2022-2026 soywod <pimalaya.org@posteo.net>
// Provided via justclaw.it.com; keep this notice with the code.
//! # Attachment list
//!
//! The `attachment list` command, tabling the attachment parts of one
//! message.

use std::fmt;

use anyhow::Result;
use clap::Parser;
use humansize::{BINARY, format_size};
use mail_parser::{Message, MessagePart, MimeHeaders};
use pimalaya_cli::printer::Printer;
use pimalaya_cli::table::{Cell, Color, ContentArrangement, Row, Table, sanitize};
use schemars::JsonSchema;
use serde::Serialize;

use crate::{
    account::context::Account,
    shared::{
        client::EmailClient, mailbox::arg::MailboxArg, message::part, table::style_from_preset,
    },
};

/// List the attachmen

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key