Skip to content
Permalink
Browse files

fix #66: add option `cmd-query`

  • Loading branch information...
lotabout committed Nov 1, 2017
1 parent 4592ed6 commit eb60583d482af95eada5bd17dc55b05ba295187c
Showing with 6 additions and 0 deletions.
  1. +2 −0 src/main.rs
  2. +4 −0 src/query.rs
@@ -89,6 +89,7 @@ Usage: sk [options]
Scripting
-q, --query \"\" specify the initial query
--cmd-query \"\" specify the initial query for interactive mode
-e, --expect KEYS comma seperated keys that can be used to complete skim
Environment variables
@@ -159,6 +160,7 @@ fn real_main() -> i32 {
.arg(Arg::with_name("cmd").long("cmd").short("cmd").takes_value(true))
.arg(Arg::with_name("interactive").long("interactive").short("i"))
.arg(Arg::with_name("query").long("query").short("q").takes_value(true))
.arg(Arg::with_name("cmd-query").long("cmd-query").takes_value(true))
.arg(Arg::with_name("regex").long("regex"))
.arg(Arg::with_name("delimiter").long("delimiter").short("d").takes_value(true))
.arg(Arg::with_name("nth").long("nth").short("n").takes_value(true))
@@ -69,6 +69,10 @@ impl Query {
self.query_before = query.chars().collect();
}

if let Some(cmd_query) = options.value_of("cmd-query") {
self.cmd_before = cmd_query.chars().collect();
}

if let Some(replstr) = options.value_of("replstr") {
self.replstr = replstr.to_string();
}

0 comments on commit eb60583

Please sign in to comment.
You can’t perform that action at this time.