aboutsummaryrefslogtreecommitdiff
path: root/src/commandline
diff options
context:
space:
mode:
Diffstat (limited to 'src/commandline')
-rw-r--r--src/commandline/builtins.rs7
-rw-r--r--src/commandline/command.rs14
2 files changed, 11 insertions, 10 deletions
diff --git a/src/commandline/builtins.rs b/src/commandline/builtins.rs
index c5999f2..882a690 100644
--- a/src/commandline/builtins.rs
+++ b/src/commandline/builtins.rs
@@ -1,13 +1,10 @@
+use super::command::RunResult;
use std::io::{Error, ErrorKind::InvalidInput};
use std::path::{Path, PathBuf};
-use super::command::RunResult;
pub(in crate::commandline) fn cd(args: &[String], home: &PathBuf) -> Result<RunResult, Error> {
if args.len() > 1 {
- return Err(Error::new(
- InvalidInput,
- "Too many arguments passed to cd",
- ));
+ return Err(Error::new(InvalidInput, "Too many arguments passed to cd"));
}
let root = if args.len() == 0 {
diff --git a/src/commandline/command.rs b/src/commandline/command.rs
index d00f420..c8b326d 100644
--- a/src/commandline/command.rs
+++ b/src/commandline/command.rs
@@ -1,8 +1,8 @@
-use std::io::{Error};
-use std::path::{PathBuf};
-use std::process::ExitStatus;
-use std::process::Command as Process;
use super::builtins::{cd, set, unset};
+use std::io::Error;
+use std::path::PathBuf;
+use std::process::Command as Process;
+use std::process::ExitStatus;
// > overwrite
// >> append
@@ -16,7 +16,11 @@ enum Redirect {
}
#[derive(Debug, PartialEq, Copy, Clone)]
-pub(in crate::commandline) enum RunIf { Always, ExitSuccess, ExitFailure }
+pub(in crate::commandline) enum RunIf {
+ Always,
+ ExitSuccess,
+ ExitFailure,
+}
impl RunIf {
pub(in crate::commandline) fn can_run(&self, status: &Option<ExitStatus>) -> bool {