//! This module handles command line argument parsing and bash completion generation,
//! matching the behavior of the Go implementation.
useclap::{Arg,ArgAction,Command};
usestd::env;
usestd::path::Path;
usecrate::config::CommandLineArgs;
/// Parse command line arguments using GNU-style options
pubfnparse_command_line()-> CommandLineArgs{
letapp=Command::new("mail2couch")
.version(env!("CARGO_PKG_VERSION"))
.about("Email backup utility for CouchDB")
.long_about("A powerful email backup utility that synchronizes mail from IMAP accounts to CouchDB databases with intelligent incremental sync, comprehensive filtering, and native attachment support.")
.arg(Arg::new("config")
.short('c')
.long("config")
.value_name("FILE")
.help("Path to configuration file")
.action(ArgAction::Set))
.arg(Arg::new("max-messages")
.short('m')
.long("max-messages")
.value_name("N")
.help("Maximum number of messages to process per mailbox per run (0 = no limit)")