From b42b08afafd904ff2adb1f00688437357532193a Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 23 Sep 2022 20:14:51 +0800 Subject: [PATCH] refactor (#450) --- README.md | 7 +++---- src/plumbing/main.rs | 7 ++----- src/plumbing/options/mod.rs | 13 ++----------- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 37c2218f0db..6b6b6ac72d0 100644 --- a/README.md +++ b/README.md @@ -27,10 +27,9 @@ Please see _'Development Status'_ for a listing of all crates and their capabili * Based on the [git-hours] algorithm. * See the [discussion][git-hours-discussion] for some performance data. * **the `gix` program** _(plumbing)_ - lower level commands for use in automation - * **progress** - * [x] **show** - provide an overview of what works and what doesn't from the perspective of the git configuration. - This is likely to change a lot over time depending on actual needs, but maybe useful for you to see - if particular git-configuration is picked up and where it deviates. + * **progress** - provide an overview of what works and what doesn't from the perspective of the git configuration. + This is likely to change a lot over time depending on actual needs, but maybe useful for you to see + if particular git-configuration is picked up and where it deviates. * **config** - list the complete git configuration in human-readable form and optionally filter sections by name. * **exclude** * [x] **query** - check if path specs are excluded via gits exclusion rules like `.gitignore`. diff --git a/src/plumbing/main.rs b/src/plumbing/main.rs index efc8ed7ea85..cdebe387dab 100644 --- a/src/plumbing/main.rs +++ b/src/plumbing/main.rs @@ -15,10 +15,7 @@ use gitoxide_core::pack::verify; use crate::{ plumbing::{ - options::{ - commit, config, credential, exclude, free, mailmap, odb, progress, remote, revision, tree, Args, - Subcommands, - }, + options::{commit, config, credential, exclude, free, mailmap, odb, remote, revision, tree, Args, Subcommands}, show_progress, }, shared::pretty::prepare_and_run, @@ -115,7 +112,7 @@ pub fn main() -> Result<()> { })?; match cmd { - Subcommands::Progress(progress::Subcommands::Show) => show_progress(), + Subcommands::Progress => show_progress(), Subcommands::Credential(cmd) => core::repository::credential( repository(Mode::StrictWithGitInstallConfig)?, match cmd { diff --git a/src/plumbing/options/mod.rs b/src/plumbing/options/mod.rs index ae2eece8169..b7c3ea58db8 100644 --- a/src/plumbing/options/mod.rs +++ b/src/plumbing/options/mod.rs @@ -89,23 +89,14 @@ pub enum Subcommands { /// Interact with the exclude files like .gitignore. #[clap(subcommand)] Exclude(exclude::Subcommands), - #[clap(subcommand)] - Progress(progress::Subcommands), + /// Display overall progress of the gitoxide project as seen from the perspective of git-config. + Progress, Config(config::Platform), /// Subcommands that need no git repository to run. #[clap(subcommand)] Free(free::Subcommands), } -pub mod progress { - - #[derive(Debug, clap::Subcommand)] - pub enum Subcommands { - /// Show the implementation progress of gitoxide based on the git configuration that it consumes. - Show, - } -} - pub mod config { /// Print all entries in a configuration file or access other sub-commands #[derive(Debug, clap::Parser)]