diff --git a/userspace/lib/stuff/src/readline.rs b/userspace/lib/stuff/src/readline.rs index 46f42165..84b69b0a 100644 --- a/userspace/lib/stuff/src/readline.rs +++ b/userspace/lib/stuff/src/readline.rs @@ -1,7 +1,4 @@ -use std::{ - fmt, - io::{self, Stdout, Write}, -}; +use std::io::{self, Stdout, Write}; use cross::term::{TermKey, TerminalInput}; diff --git a/userspace/sysutils/src/tar.rs b/userspace/sysutils/src/tar.rs index f2ee9303..bbc8256d 100644 --- a/userspace/sysutils/src/tar.rs +++ b/userspace/sysutils/src/tar.rs @@ -1,7 +1,6 @@ use std::{ - fmt, fs::{self, File}, - io::{self, stdout, BufWriter, Read, Seek, Write}, + io::{self, BufWriter, Read, Seek, Write}, path::{Path, PathBuf}, process::ExitCode, }; @@ -42,6 +41,8 @@ enum Error { NoAction, #[error("Multiple actions specified, use only -c/-t/-x")] MultipleActions, + #[error("No inputs specified, aborting")] + NoInputs, } trait ContextualizeError { @@ -87,7 +88,7 @@ fn create_archive( .contextualize(fs_path)?; Ok(()) } else if fs_path.is_dir() { - let mut dir = fs::read_dir(fs_path).contextualize(fs_path)?; + let dir = fs::read_dir(fs_path).contextualize(fs_path)?; for entry in dir { let entry = entry.contextualize(fs_path)?; let filename = entry.file_name(); @@ -102,12 +103,13 @@ fn create_archive( } Ok(()) } else { - todo!() + eprintln!("Skipping {}: not supported", fs_path.display()); + Ok(()) } } if inputs.is_empty() { - todo!(); + return Err(Error::NoInputs); } let archive = output.as_ref(); @@ -126,8 +128,8 @@ fn create_archive( // fs path == archive path write_path(&mut writer, input, input)?; } else { - todo!(); - // write_path(&mut writer, chdir, chdir.join(input).as_path())?; + let fs_path = chdir.join(input); + write_path(&mut writer, &fs_path, input)?; } } diff --git a/userspace/tools/shell/src/main.rs b/userspace/tools/shell/src/main.rs index 6bbb1c0e..f77166d6 100644 --- a/userspace/tools/shell/src/main.rs +++ b/userspace/tools/shell/src/main.rs @@ -24,7 +24,7 @@ use cross::{ }; use error::Error; use exec::Outcome; -use stuff::readline::{self, ReadlineError, ReadlineProvider}; +use stuff::readline::{self, ReadlineProvider}; pub mod builtin; pub mod command; @@ -112,7 +112,7 @@ impl ShellInput { &mut self, readline_provider: &mut ReadlineProviderImpl, line: &mut String, - continuation: bool, + _continuation: bool, ) -> Result { match self { Self::File(file) => Ok(file.read_line(line)?),