mirror of
https://github.com/lsd-rs/lsd
synced 2024-12-15 06:22:47 +00:00
Add the -1 option
This commit is contained in:
parent
9e16d6620b
commit
a4a494a5bc
2 changed files with 6 additions and 3 deletions
|
@ -12,7 +12,7 @@ impl<'a> Display<'a> {
|
|||
}
|
||||
|
||||
pub fn print_outputs(&self, outputs: Vec<String>) {
|
||||
if self.options.display_long {
|
||||
if self.options.display_long || self.options.display_online {
|
||||
self.print_one_per_line(&outputs);
|
||||
} else {
|
||||
self.print_grid(outputs);
|
||||
|
|
|
@ -21,19 +21,22 @@ use core::Core;
|
|||
pub struct Options {
|
||||
pub display_all: bool,
|
||||
pub display_long: bool,
|
||||
pub display_online: bool,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let matches = App::new("lsd")
|
||||
.about("A ls comment with a lot of pretty colors and some other stuff.")
|
||||
.arg(Arg::with_name("FILE").multiple(true).default_value("."))
|
||||
.arg(Arg::with_name("all").short("a"))
|
||||
.arg(Arg::with_name("long").short("l"))
|
||||
.arg(Arg::with_name("all").short("a").long("all"))
|
||||
.arg(Arg::with_name("long").short("l").long("long"))
|
||||
.arg(Arg::with_name("oneline").short("1").long("oneline"))
|
||||
.get_matches();
|
||||
|
||||
let options = Options {
|
||||
display_all: matches.is_present("all"),
|
||||
display_long: matches.is_present("long"),
|
||||
display_online: matches.is_present("oneline"),
|
||||
};
|
||||
|
||||
let inputs: Vec<&str> = matches
|
||||
|
|
Loading…
Reference in a new issue