Skip to content

Commit

Permalink
rename check command to doctor
Browse files Browse the repository at this point in the history
  • Loading branch information
soywod committed Apr 14, 2024
1 parent 1f4ff64 commit 69e5a76
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Replaced `log` by [`tracing`](https://crates.io/crates/tracing) for better log management.
- Renamed `folder.filter` to `folder.filters` in order to match lib types.
- Renamed `envelope.filter` to `envelope.filters` in order to match lib types.
- Renamed `check` command to `doctor`.

## [0.1.0] - 2024-04-10

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "neverest"
description = "CLI to synchronize and backup emails"
description = "CLI to synchronize, backup and restore emails"
version = "0.1.0"
authors = ["soywod <[email protected]>"]
edition = "2021"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! # Check up account command
//! # Doctor account command
//!
//! This module contains the [`clap`] command for checking up left and
//! right backends integrity of a given account.
Expand Down Expand Up @@ -26,15 +26,15 @@ use crate::{
/// the configuration is valid, if backend can be created and if
/// sessions work as expected.
#[derive(Debug, Parser)]
pub struct CheckUpAccountCommand {
pub struct DoctorAccountCommand {
#[command(flatten)]
pub account: OptionalAccountNameArg,
}

impl CheckUpAccountCommand {
impl DoctorAccountCommand {
#[instrument(skip_all)]
pub async fn execute(self, printer: &mut impl Printer, config: &Config) -> Result<()> {
info!("executing check up account command");
info!("executing doctor account command");

let (name, config) = config.into_account_config(self.account.name.as_deref())?;
printer.print_log(format!("Checking `{name}` account integrity…"))?;
Expand Down
2 changes: 1 addition & 1 deletion src/account/command/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
//! [`configure`] to configure secrets of a given account, and
//! [`sync`] to synchronize two backends of a given account.

pub mod check_up;
pub mod configure;
pub mod doctor;
pub mod sync;
8 changes: 4 additions & 4 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use tracing_subscriber::filter::LevelFilter;

use crate::{
account::command::{
check_up::CheckUpAccountCommand, configure::ConfigureAccountCommand,
configure::ConfigureAccountCommand, doctor::DoctorAccountCommand,
sync::SynchronizeAccountCommand,
},
completion::command::GenerateCompletionCommand,
Expand Down Expand Up @@ -121,8 +121,8 @@ impl Cli {

#[derive(Subcommand, Debug)]
pub enum NeverestCommand {
#[command(alias = "check-up", alias = "checkup")]
Check(CheckUpAccountCommand),
#[command(alias = "check-up", alias = "checkup", visible_alias = "check")]
Doctor(DoctorAccountCommand),

#[command(alias = "cfg")]
Configure(ConfigureAccountCommand),
Expand All @@ -142,7 +142,7 @@ pub enum NeverestCommand {
impl NeverestCommand {
pub async fn execute(self, printer: &mut impl Printer, config_paths: &[PathBuf]) -> Result<()> {
match self {
Self::Check(cmd) => {
Self::Doctor(cmd) => {
let config = Config::from_paths_or_default(config_paths).await?;
cmd.execute(printer, &config).await
}
Expand Down

0 comments on commit 69e5a76

Please sign in to comment.