mirror of
https://github.com/pimalaya/himalaya.git
synced 2026-06-17 13:17:55 +08:00
clean doc
This commit is contained in:
+10
-10
@@ -1,34 +1,34 @@
|
||||
use clap::Parser;
|
||||
use email::account::config::DEFAULT_INBOX_FOLDER;
|
||||
|
||||
/// The folder name argument parser
|
||||
/// The folder name argument parser.
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct FolderNameArg {
|
||||
/// The name of the folder
|
||||
#[arg(name = "folder-name", value_name = "FOLDER")]
|
||||
/// The name of the folder.
|
||||
#[arg(name = "folder_name", value_name = "FOLDER")]
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
/// The optional folder name argument parser
|
||||
/// The optional folder name argument parser.
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct FolderNameOptionalArg {
|
||||
/// The name of the folder
|
||||
#[arg(name = "folder-name", value_name = "FOLDER", default_value = DEFAULT_INBOX_FOLDER)]
|
||||
/// The name of the folder.
|
||||
#[arg(name = "folder_name", value_name = "FOLDER", default_value = DEFAULT_INBOX_FOLDER)]
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
/// The source folder name argument parser
|
||||
/// The source folder name argument parser.
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct SourceFolderNameArg {
|
||||
/// The name of the source folder
|
||||
/// The name of the source folder.
|
||||
#[arg(name = "from-folder-name", value_name = "FROM")]
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
/// The target folder name argument parser
|
||||
/// The target folder name argument parser.
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct TargetFolderNameArg {
|
||||
/// The name of the target folder
|
||||
/// The name of the target folder.
|
||||
#[arg(name = "to-folder-name", value_name = "TO")]
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
@@ -3,21 +3,24 @@ use clap::Parser;
|
||||
use log::info;
|
||||
|
||||
use crate::{
|
||||
account::arg::name::AccountNameFlag, backend::Backend, cache::arg::disable::DisableCacheFlag,
|
||||
account::arg::name::AccountNameFlag, backend::Backend, cache::arg::disable::CacheDisableFlag,
|
||||
config::TomlConfig, folder::arg::name::FolderNameArg, printer::Printer,
|
||||
};
|
||||
|
||||
/// Create a new folder
|
||||
/// Create a new folder.
|
||||
///
|
||||
/// This command allows you to create a new folder using the given
|
||||
/// name.
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct FolderCreateCommand {
|
||||
#[command(flatten)]
|
||||
pub folder: FolderNameArg,
|
||||
|
||||
#[command(flatten)]
|
||||
pub account: AccountNameFlag,
|
||||
pub cache: CacheDisableFlag,
|
||||
|
||||
#[command(flatten)]
|
||||
pub cache: DisableCacheFlag,
|
||||
pub account: AccountNameFlag,
|
||||
}
|
||||
|
||||
impl FolderCreateCommand {
|
||||
|
||||
@@ -5,24 +5,24 @@ use log::info;
|
||||
use std::process;
|
||||
|
||||
use crate::{
|
||||
account::arg::name::AccountNameFlag, backend::Backend, cache::arg::disable::DisableCacheFlag,
|
||||
account::arg::name::AccountNameFlag, backend::Backend, cache::arg::disable::CacheDisableFlag,
|
||||
config::TomlConfig, folder::arg::name::FolderNameArg, printer::Printer,
|
||||
};
|
||||
|
||||
/// Delete a folder
|
||||
/// Delete a folder.
|
||||
///
|
||||
/// All emails from a given folder are definitely deleted. The folder
|
||||
/// is also deleted after execution of the command.
|
||||
/// All emails from the given folder are definitely deleted. The
|
||||
/// folder is also deleted after execution of the command.
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct FolderDeleteCommand {
|
||||
#[command(flatten)]
|
||||
pub folder: FolderNameArg,
|
||||
|
||||
#[command(flatten)]
|
||||
pub account: AccountNameFlag,
|
||||
pub cache: CacheDisableFlag,
|
||||
|
||||
#[command(flatten)]
|
||||
pub cache: DisableCacheFlag,
|
||||
pub account: AccountNameFlag,
|
||||
}
|
||||
|
||||
impl FolderDeleteCommand {
|
||||
|
||||
@@ -3,14 +3,14 @@ use clap::Parser;
|
||||
use log::info;
|
||||
|
||||
use crate::{
|
||||
account::arg::name::AccountNameFlag, backend::Backend, cache::arg::disable::DisableCacheFlag,
|
||||
account::arg::name::AccountNameFlag, backend::Backend, cache::arg::disable::CacheDisableFlag,
|
||||
config::TomlConfig, folder::arg::name::FolderNameArg, printer::Printer,
|
||||
};
|
||||
|
||||
/// Expunge a folder
|
||||
/// Expunge a folder.
|
||||
///
|
||||
/// The concept of expunging is similar to the IMAP one: it definitely
|
||||
/// deletes emails from a given folder that contain the "deleted"
|
||||
/// deletes emails from the given folder that contain the "deleted"
|
||||
/// flag.
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct FolderExpungeCommand {
|
||||
@@ -18,10 +18,10 @@ pub struct FolderExpungeCommand {
|
||||
pub folder: FolderNameArg,
|
||||
|
||||
#[command(flatten)]
|
||||
pub account: AccountNameFlag,
|
||||
pub cache: CacheDisableFlag,
|
||||
|
||||
#[command(flatten)]
|
||||
pub cache: DisableCacheFlag,
|
||||
pub account: AccountNameFlag,
|
||||
}
|
||||
|
||||
impl FolderExpungeCommand {
|
||||
|
||||
@@ -5,24 +5,26 @@ use log::info;
|
||||
use crate::{
|
||||
account::arg::name::AccountNameFlag,
|
||||
backend::Backend,
|
||||
cache::arg::disable::DisableCacheFlag,
|
||||
cache::arg::disable::CacheDisableFlag,
|
||||
config::TomlConfig,
|
||||
folder::Folders,
|
||||
printer::{PrintTableOpts, Printer},
|
||||
ui::arg::max_width::MaxTableWidthFlag,
|
||||
ui::arg::max_width::TableMaxWidthFlag,
|
||||
};
|
||||
|
||||
/// List all folders
|
||||
/// List all folders.
|
||||
///
|
||||
/// This command allows you to list all exsting folders.
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct FolderListCommand {
|
||||
#[command(flatten)]
|
||||
pub table: MaxTableWidthFlag,
|
||||
pub table: TableMaxWidthFlag,
|
||||
|
||||
#[command(flatten)]
|
||||
pub cache: CacheDisableFlag,
|
||||
|
||||
#[command(flatten)]
|
||||
pub account: AccountNameFlag,
|
||||
|
||||
#[command(flatten)]
|
||||
pub cache: DisableCacheFlag,
|
||||
}
|
||||
|
||||
impl FolderListCommand {
|
||||
|
||||
@@ -14,26 +14,24 @@ use self::{
|
||||
list::FolderListCommand, purge::FolderPurgeCommand,
|
||||
};
|
||||
|
||||
/// Subcommand to manage accounts
|
||||
/// Manage folders.
|
||||
///
|
||||
/// A folder (AKA mailbox, or directory) contains envelopes and
|
||||
/// messages. This subcommand allows you to manage them.
|
||||
#[derive(Debug, Subcommand)]
|
||||
pub enum FolderSubcommand {
|
||||
/// Create a new folder
|
||||
#[command(alias = "add")]
|
||||
#[command(alias = "add", alias = "new")]
|
||||
Create(FolderCreateCommand),
|
||||
|
||||
/// List all folders
|
||||
#[command(alias = "lst")]
|
||||
List(FolderListCommand),
|
||||
|
||||
/// Expunge a folder
|
||||
#[command()]
|
||||
Expunge(FolderExpungeCommand),
|
||||
|
||||
/// Purge a folder
|
||||
#[command()]
|
||||
Purge(FolderPurgeCommand),
|
||||
|
||||
/// Delete a folder
|
||||
#[command(alias = "remove", alias = "rm")]
|
||||
Delete(FolderDeleteCommand),
|
||||
}
|
||||
|
||||
@@ -5,24 +5,24 @@ use log::info;
|
||||
use std::process;
|
||||
|
||||
use crate::{
|
||||
account::arg::name::AccountNameFlag, backend::Backend, cache::arg::disable::DisableCacheFlag,
|
||||
account::arg::name::AccountNameFlag, backend::Backend, cache::arg::disable::CacheDisableFlag,
|
||||
config::TomlConfig, folder::arg::name::FolderNameArg, printer::Printer,
|
||||
};
|
||||
|
||||
/// Purge a folder
|
||||
/// Purge a folder.
|
||||
///
|
||||
/// All emails from a given folder are definitely deleted. The purged
|
||||
/// folder will remain empty after executing of the command.
|
||||
/// All emails from the given folder are definitely deleted. The
|
||||
/// purged folder will remain empty after execution of the command.
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct FolderPurgeCommand {
|
||||
#[command(flatten)]
|
||||
pub folder: FolderNameArg,
|
||||
|
||||
#[command(flatten)]
|
||||
pub account: AccountNameFlag,
|
||||
pub cache: CacheDisableFlag,
|
||||
|
||||
#[command(flatten)]
|
||||
pub cache: DisableCacheFlag,
|
||||
pub account: AccountNameFlag,
|
||||
}
|
||||
|
||||
impl FolderPurgeCommand {
|
||||
|
||||
Reference in New Issue
Block a user