Skip to content

Commit

Permalink
refactor(bin): List -> ListCmd
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed Jun 30, 2024
1 parent 08f1efc commit 52713d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions rocks-bin/src/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ use rocks_lib::{config::Config, tree::Tree};
use text_trees::{FormatCharacters, StringTreeNode, TreeFormatting};

#[derive(Args)]
pub struct List {
pub struct ListCmd {
#[arg(long)]
outdated: bool,
#[arg(long)]
porcelain: bool,
}

pub fn list(list_data: List, config: &Config) -> Result<()> {
pub fn list_installed(list_data: ListCmd, config: &Config) -> Result<()> {
let tree = Tree::new(
&config.tree,
config
Expand Down
4 changes: 2 additions & 2 deletions rocks-bin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ enum Commands {
/// Check syntax of a rockspec.
Lint,
/// List currently installed rocks.
List(list::List),
List(list::ListCmd),
/// Compile package in current directory using a rockspec.
Make,
/// Auto-write a rockspec for a new version of the rock.
Expand Down Expand Up @@ -177,7 +177,7 @@ async fn main() {
rockspec::write_rockspec(rockspec_data).await.unwrap()
}
Commands::Build(build_data) => build::build(build_data, &config).unwrap(),
Commands::List(list_data) => list::list(list_data, &config).unwrap(),
Commands::List(list_data) => list::list_installed(list_data, &config).unwrap(),
_ => unimplemented!(),
},
None => {
Expand Down

0 comments on commit 52713d3

Please sign in to comment.