@@ -67,36 +67,6 @@ struct Record {
6767 usage : Usage ,
6868}
6969
70- // TODO implement this without table, how hard is it?
71-
72- // impl Tabled for Record {
73- // const LENGTH: usize = 3;
74-
75- // fn fields(&self) -> Vec<Cow<'_, str>> {
76- // let mut tokens = self.config.split('.');
77- // let mut buf = vec![{
78- // let name = tokens.next().expect("present");
79- // if name == "gitoxide" {
80- // name.bold().green()
81- // } else {
82- // name.bold()
83- // }
84- // .to_string()
85- // }];
86- // buf.extend(tokens.map(ToOwned::to_owned));
87-
88- // vec![
89- // Cow::Borrowed(self.usage.icon()),
90- // buf.join(".").into(),
91- // self.usage.to_string().into(),
92- // ]
93- // }
94-
95- // fn headers() -> Vec<Cow<'static, str>> {
96- // vec!["icon".into(), "key".into(), "info".into()]
97- // }
98- // }
99-
10070static GIT_CONFIG : & [ Record ] = & [
10171 Record {
10272 config : "core.symlinks" ,
@@ -571,22 +541,17 @@ pub fn show_progress() -> anyhow::Result<()> {
571541 . count( )
572542 ) ?;
573543
574- // TODO implement this without table, how hard is it?
575-
576- // let mut table = tabled::Table::new(sorted);
577- // let table = table.with(Style::blank()).with(Extract::rows(1..));
578- // println!(
579- // "{}",
580- // if let Some((terminal_size::Width(w), _)) = terminal_size::terminal_size() {
581- // table.with(Width::wrap(w as usize).keep_words().priority::<PriorityMax>())
582- // } else {
583- // table
584- // }
585- // );
586-
587- // noted: reverted from https://github.com/Byron/gitoxide/commit/65e64964c7cd151e53e5a7d4b9ba8fabda1c0e16
588544 for Record { config, usage } in sorted {
589- println ! ( "{} {}: {usage}" , usage. icon( ) , config. bold( ) , ) ;
545+ println ! (
546+ "{icon} {config: <50}: {usage}" ,
547+ icon = usage. icon( ) ,
548+ config = if let Some ( config) = config. strip_prefix( "gitoxide." ) {
549+ format!( "{gitoxide}{config}" , gitoxide = "gitoxide." . green( ) )
550+ } else {
551+ config. to_string( )
552+ }
553+ . bold( ) ,
554+ ) ;
590555 }
591556
592557 println ! ( "{buf}" ) ;
0 commit comments