Skip to content

Commit 47764ef

Browse files
committed
Add support for the ls command to the multicall binary
1 parent 5cd0c62 commit 47764ef

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/bin/ls/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::io::{self, BufWriter, stdout};
1010

1111
const CURRENT_DIR_PATH: &str = ".";
1212

13-
fn main() -> Result {
13+
pub fn main() -> Result {
1414
let mut stdout = stdout();
1515
let winsize = get_win_size();
1616
let _cfg = settings::parse_arguments(winsize.ws_col, &mut stdout)?;

src/bin/ls/settings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![allow(dead_code)]
2-
use crate::options::*;
2+
use super::options::*;
33
use puppyutils::{Result, cli_with_args};
44
use sap::Parser;
55
use std::io;

src/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ use std::{borrow::Cow, env::current_exe, os::unix::ffi::OsStrExt, path::PathBuf}
33
use puppyutils::{Exit, Result};
44

55
pub mod bin {
6-
// pub mod ls;FIXME: This does not work because the entrypoint is named main.rs, need to find an elegant solution
7-
86
pub mod r#false;
7+
#[path = "ls/main.rs"]
8+
pub mod ls;
99
pub mod mkdir;
1010
pub mod pwd;
1111
pub mod r#true;
@@ -26,6 +26,7 @@ fn main() -> Result {
2626

2727
match util.as_bytes() {
2828
b"false" => bin::r#false::main(),
29+
b"ls" => bin::ls::main(),
2930
b"mkdir" => bin::mkdir::main(),
3031
b"pwd" => bin::pwd::main(),
3132
b"true" => bin::r#true::main(),

0 commit comments

Comments
 (0)