Skip to content

Commit a627d69

Browse files
committed
[option] add --reverse
1 parent c7c7c8d commit a627d69

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Usage: sk [options]
7272
--ansi parse ANSI color codes for input strings
7373
--color [BASE][,COLOR:ANSI]
7474
change color theme
75+
--reverse Reverse orientation
7576
7677
Scripting
7778
-q, --query \"\" specify the initial query
@@ -118,6 +119,7 @@ fn real_main() -> i32 {
118119
opts.optopt("", "with-nth", "specify the fields to be transformed", "1,2..5");
119120
opts.optopt("I", "", "replace `replstr` with the selected item", "replstr");
120121
opts.optopt("", "color", "change color theme", "[BASE][,COLOR:ANSI]");
122+
opts.optflag("", "reverse", "reverse orientation");
121123
opts.optflag("", "version", "print out the current version of skim");
122124

123125
let mut args = Vec::new();

src/model.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ impl Model {
8383
self.multi_selection = false;
8484
}
8585

86+
if options.opt_present("reverse") {
87+
self.reverse = true;
88+
}
89+
8690
if let Some(color) = options.opt_str("color") {
8791
self.theme = ColorTheme::from_options(&color);
8892
}

0 commit comments

Comments
 (0)