Remove unused help shell. Slight cleanup and improvement. (#3258)

This commit is contained in:
Andrés N. Robalino
2021-04-03 18:56:46 -05:00
committed by GitHub
parent 28e1a7915d
commit 1c941557c3
14 changed files with 97 additions and 368 deletions

View File

@ -58,6 +58,10 @@ impl Clone for FilesystemShell {
}
impl FilesystemShell {
fn is_cli(&self) -> bool {
matches!(&self.mode, FilesystemShellMode::Cli)
}
pub fn basic(mode: FilesystemShellMode) -> Result<FilesystemShell, Error> {
let path = match std::env::current_dir() {
Ok(path) => path,
@ -295,7 +299,7 @@ impl Shell for FilesystemShell {
//Loading local configs in script mode, makes scripts behave different on different
//filesystems and might therefore surprise users. That's why we only load them in cli mode.
if self.mode == FilesystemShellMode::Cli {
if self.is_cli() {
match dunce::canonicalize(self.path()) {
Err(e) => {
trace!(