refactor: renaming "get" command to "version"

This commit is contained in:
D. Moonfire 2024-03-09 13:31:20 -06:00
parent d6c56b3bea
commit df8b8be198
2 changed files with 5 additions and 5 deletions

View file

@ -2,7 +2,7 @@ use anyhow::Result;
use clap::{Parser, Subcommand}; use clap::{Parser, Subcommand};
use slog::{o, Drain, Level}; use slog::{o, Drain, Level};
mod get; mod version;
#[derive(Debug, Parser)] #[derive(Debug, Parser)]
#[clap( #[clap(
@ -20,7 +20,7 @@ pub struct RootCommand {
#[derive(Debug, Subcommand)] #[derive(Debug, Subcommand)]
pub enum RootSubcommands { pub enum RootSubcommands {
/// Calculates the version based on the current commits. /// Calculates the version based on the current commits.
Get(get::GetCommand), Version(version::VersionCommand),
} }
impl RootCommand { impl RootCommand {
@ -44,7 +44,7 @@ impl RootCommand {
// Pass the command in. // Pass the command in.
match &self.command { match &self.command {
RootSubcommands::Get(cmd) => cmd.run(log).await?, RootSubcommands::Version(cmd) => cmd.run(log).await?,
}; };
Ok(()) Ok(())

View file

@ -11,7 +11,7 @@ use std::str::FromStr;
/// Gets the current version based on commits. /// Gets the current version based on commits.
#[derive(Debug, Parser)] #[derive(Debug, Parser)]
pub struct GetCommand {} pub struct VersionCommand {}
#[derive(Debug, Clone, PartialOrd, PartialEq)] #[derive(Debug, Clone, PartialOrd, PartialEq)]
enum VersionBump { enum VersionBump {
@ -21,7 +21,7 @@ enum VersionBump {
Major = 3, Major = 3,
} }
impl GetCommand { impl VersionCommand {
pub async fn run(&self, log: slog::Logger) -> Result<()> { pub async fn run(&self, log: slog::Logger) -> Result<()> {
// Figure out the path we are loading. // Figure out the path we are loading.
let current_dir = let current_dir =