refactor: Improve commands running and make the signer optional for some commands

Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
Awiteb
2025-06-08 20:12:32 +00:00
parent 5dc8e31eb3
commit b1027b3b04
19 changed files with 107 additions and 51 deletions

View File

@@ -19,6 +19,13 @@ use crate::error::N34Result;
/// A trait defining the interface for command runners in the CLI.
pub trait CommandRunner {
/// Whether this command needs the relays option (false by default).
/// Only applies to commands, not subcommands.
const NEED_RELAYS: bool = false;
/// Indicates if this command requires the signer. Defaults to true.
/// Only applies to commands, not subcommands.
const NEED_SIGNER: bool = true;
/// Executes the command and returns a Result indicating success or failure.
fn run(self, options: CliOptions) -> impl Future<Output = N34Result<()>> + Send;
}