adjust api, test commands with a greenmail instance

This commit is contained in:
Clément DOUIN
2023-12-09 09:36:26 +01:00
parent ef3214f36f
commit 04e721d591
31 changed files with 150 additions and 112 deletions
+12 -3
View File
@@ -1,11 +1,12 @@
use clap::Parser;
use email::account::config::DEFAULT_INBOX_FOLDER;
/// The folder name argument parser.
/// The optional folder name flag parser.
#[derive(Debug, Parser)]
pub struct FolderNameArg {
pub struct FolderNameOptionalFlag {
/// The name of the folder.
#[arg(name = "folder_name", value_name = "FOLDER")]
#[arg(long = "folder", short = 'f')]
#[arg(name = "folder_name", value_name = "NAME", default_value = DEFAULT_INBOX_FOLDER)]
pub name: String,
}
@@ -17,6 +18,14 @@ pub struct FolderNameOptionalArg {
pub name: String,
}
/// The required folder name argument parser.
#[derive(Debug, Parser)]
pub struct FolderNameArg {
/// The name of the folder.
#[arg(name = "folder_name", value_name = "FOLDER")]
pub name: String,
}
/// The source folder name argument parser.
#[derive(Debug, Parser)]
pub struct SourceFolderNameArg {
+2 -2
View File
@@ -16,8 +16,8 @@ use self::{
/// Manage folders.
///
/// A folder (AKA mailbox, or directory) contains envelopes and
/// messages. This subcommand allows you to manage them.
/// A folder (as known as mailbox, or directory) contains one or more
/// emails. This subcommand allows you to manage them.
#[derive(Debug, Subcommand)]
pub enum FolderSubcommand {
#[command(alias = "add", alias = "new")]