From 1978039f70c8bffc77fa788935f0d669ed06428f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DOUIN?= Date: Tue, 10 Mar 2026 14:13:58 +0100 Subject: [PATCH] fix: add missing manuals and completions commands --- src/cli.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index d09c5d9a..9f7caa85 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,13 +1,14 @@ use std::path::PathBuf; use anyhow::{bail, Result}; -use clap::{Parser, Subcommand}; +use clap::{CommandFactory, Parser, Subcommand}; use pimalaya_toolbox::{ config::TomlConfig, long_version, terminal::{ clap::{ args::{AccountFlag, JsonFlag, LogFlags}, + commands::{CompletionCommand, ManualCommand}, parsers::path_parser, }, printer::Printer, @@ -52,6 +53,9 @@ pub struct HimalayaCli { #[derive(Debug, Subcommand)] pub enum BackendCommand { + Manuals(ManualCommand), + Completions(CompletionCommand), + #[cfg(feature = "imap")] #[command(subcommand)] Imap(ImapCommand), @@ -68,6 +72,9 @@ impl BackendCommand { account_name: Option<&str>, ) -> Result<()> { match self { + Self::Manuals(cmd) => cmd.execute(printer, HimalayaCli::command()), + Self::Completions(cmd) => cmd.execute(printer, HimalayaCli::command()), + #[cfg(feature = "imap")] Self::Imap(cmd) => { let config = Config::from_paths_or_default(config_paths)?; @@ -94,8 +101,6 @@ impl BackendCommand { cmd.exec(printer, account) } - #[allow(unreachable_patterns)] - _ => bail!("No backend available"), } } }