Skip to content

Commit dab4668

Browse files
committed
refactor: review cli arguments
1 parent f2af7d1 commit dab4668

File tree

2 files changed

+4
-47
lines changed

2 files changed

+4
-47
lines changed

cli/src/lib.rs

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -129,18 +129,6 @@ enum CodeownersSubcommand {
129129
about = "Display aggregated owner statistics and associations"
130130
)]
131131
ListOwners {
132-
/// Comma-separated tags filter
133-
#[arg(long, value_name = "LIST")]
134-
filter_tags: Option<String>,
135-
136-
/// Display tags in output
137-
#[arg(long)]
138-
show_tags: bool,
139-
140-
/// Only show owners with >= NUM files
141-
#[arg(long, value_name = "NUM")]
142-
min_files: Option<u32>,
143-
144132
/// Output format: text|json|bincode
145133
#[arg(long, value_name = "FORMAT", default_value = "text", value_parser = parse_output_format)]
146134
format: OutputFormat,
@@ -150,14 +138,6 @@ enum CodeownersSubcommand {
150138
about = "Audit and analyze tag usage across CODEOWNERS files"
151139
)]
152140
ListTags {
153-
/// Warn if tags have fewer than NUM owners
154-
#[arg(long, value_name = "NUM")]
155-
verify_owners: Option<u32>,
156-
157-
/// Sort by: tag|count|owners
158-
#[arg(long, value_name = "FIELD", default_value = "tag")]
159-
sort: String,
160-
161141
/// Output format: text|json|bincode
162142
#[arg(long, value_name = "FORMAT", default_value = "text", value_parser = parse_output_format)]
163143
format: OutputFormat,
@@ -232,22 +212,8 @@ pub(crate) fn codeowners(subcommand: &CodeownersSubcommand) -> Result<()> {
232212
*unowned,
233213
format,
234214
),
235-
CodeownersSubcommand::ListOwners {
236-
filter_tags,
237-
show_tags,
238-
min_files,
239-
format,
240-
} => commands::codeowners_list_owners(
241-
filter_tags.as_deref(),
242-
*show_tags,
243-
min_files.as_ref(),
244-
format,
245-
),
246-
CodeownersSubcommand::ListTags {
247-
verify_owners,
248-
sort,
249-
format,
250-
} => commands::codeowners_list_tags(verify_owners.as_ref(), sort, format),
215+
CodeownersSubcommand::ListOwners { format } => commands::codeowners_list_owners(format),
216+
CodeownersSubcommand::ListTags { format } => commands::codeowners_list_tags(format),
251217
CodeownersSubcommand::Validate { strict, output } => {
252218
commands::codeowners_validate(*strict, output)
253219
}

core/src/commands.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,15 @@ pub fn codeowners_list_files(
4444
}
4545

4646
/// Display aggregated owner statistics and associations
47-
pub fn codeowners_list_owners(
48-
filter_tags: Option<&str>, show_tags: bool, min_files: Option<&u32>, format: &OutputFormat,
49-
) -> Result<()> {
50-
info!("Listing owners with filter_tags: {:?}", filter_tags);
51-
info!("Show tags: {}", show_tags);
52-
info!("Min files: {:?}", min_files);
47+
pub fn codeowners_list_owners(format: &OutputFormat) -> Result<()> {
5348
info!("Output format: {}", format);
5449

5550
println!("Owners listing completed");
5651
Ok(())
5752
}
5853

5954
/// Audit and analyze tag usage across CODEOWNERS files
60-
pub fn codeowners_list_tags(
61-
verify_owners: Option<&u32>, sort: &str, format: &OutputFormat,
62-
) -> Result<()> {
63-
info!("Listing tags with verify_owners: {:?}", verify_owners);
64-
info!("Sort by: {}", sort);
55+
pub fn codeowners_list_tags(format: &OutputFormat) -> Result<()> {
6556
info!("Output format: {}", format);
6657

6758
println!("Tags listing completed");

0 commit comments

Comments
 (0)