mirror of
https://github.com/sayanarijit/xplr.git
synced 2024-10-03 22:07:22 +03:00
Move definitions runner related functions
fn runner() and fn from_cli(cli: Cli) util functions are located to app.rs. However, those are utils for runner. So this commit change the functions to runner.rs.
This commit is contained in:
parent
a3b400d749
commit
13d046e6ad
@ -1,5 +1,5 @@
|
||||
fn main() {
|
||||
match xplr::app::runner().and_then(|a| a.run()) {
|
||||
match xplr::runner::runner().and_then(|a| a.run()) {
|
||||
Ok(Some(out)) => print!("{}", out),
|
||||
Ok(None) => {}
|
||||
Err(err) => {
|
||||
|
12
src/app.rs
12
src/app.rs
@ -1,11 +1,9 @@
|
||||
use crate::cli::Cli;
|
||||
use crate::config::Config;
|
||||
use crate::config::Mode;
|
||||
use crate::explorer;
|
||||
use crate::input::Key;
|
||||
use crate::lua;
|
||||
use crate::permissions::Permissions;
|
||||
use crate::runner::Runner;
|
||||
use crate::ui::Layout;
|
||||
use anyhow::{bail, Result};
|
||||
use chrono::{DateTime, Local};
|
||||
@ -2537,13 +2535,3 @@ impl App {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a new runner object passing the default arguments
|
||||
pub fn runner() -> Result<Runner> {
|
||||
Runner::new()
|
||||
}
|
||||
|
||||
/// Create a new runner object passing the given arguments
|
||||
pub fn from_cli(cli: Cli) -> Result<Runner> {
|
||||
Runner::from_cli(cli)
|
||||
}
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
use std::env;
|
||||
|
||||
use xplr::app;
|
||||
use xplr::cli::Cli;
|
||||
use xplr::runner;
|
||||
|
||||
fn main() {
|
||||
let cli = Cli::parse(env::args()).unwrap_or_else(|e| {
|
||||
@ -47,7 +47,7 @@ fn main() {
|
||||
} else if cli.version {
|
||||
println!("xplr {}", xplr::app::VERSION);
|
||||
} else {
|
||||
match app::from_cli(cli).and_then(|a| a.run()) {
|
||||
match runner::from_cli(cli).and_then(|a| a.run()) {
|
||||
Ok(Some(out)) => print!("{}", out),
|
||||
Ok(None) => {}
|
||||
Err(err) => {
|
||||
|
@ -568,3 +568,13 @@ impl Runner {
|
||||
result
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a new runner object passing the default arguments
|
||||
pub fn runner() -> Result<Runner> {
|
||||
Runner::new()
|
||||
}
|
||||
|
||||
/// Create a new runner object passing the given arguments
|
||||
pub fn from_cli(cli: Cli) -> Result<Runner> {
|
||||
Runner::from_cli(cli)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user