Skip to content

Commit

Permalink
Update Pls to support subcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvkb committed Sep 14, 2024
1 parent 2a4254e commit dc8e066
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn main() {
env_logger::init();
debug!("Hello!");

PLS.run();
PLS.cmd();

debug!("Bye!");
}
11 changes: 10 additions & 1 deletion src/models/pls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ pub struct Pls {
}

impl Pls {
/// Handle the `pls` command and its subcommands.
///
/// This is the entrypoint of the application that takes over the
/// control from `main`.
pub fn cmd(&self) {
// TODO: Handle subcommands.
self.run();
}

/// Run `pls`.
///
/// This is the entrypoint of the `Pls` class, and once control is passed
Expand All @@ -28,7 +37,7 @@ impl Pls {
/// The primary function of this method is to organise the input list of
/// paths into groups and then delegate to each group the job of listing
/// their entries and rendering the layout.
pub fn run(&self) {
fn run(&self) {
let inputs: Vec<_> = self
.args
.paths
Expand Down

0 comments on commit dc8e066

Please sign in to comment.