Implemented -o opt for complete/compgen builtins

Completion candidates now come with a space by default, unless it's a directory
This commit is contained in:
2026-02-27 09:44:33 -05:00
parent 30bc394d18
commit 3d3693e2c3
11 changed files with 161 additions and 68 deletions

View File

@@ -1,9 +1,7 @@
use std::fmt::Display;
use crate::{
libsh::term::{Style, Styled},
parse::lex::Span,
prelude::*,
getopt::Opt, libsh::term::{Style, Styled}, parse::lex::Span, prelude::*
};
pub type ShResult<T> = Result<T, ShErr>;
@@ -395,6 +393,7 @@ impl From<Errno> for ShErr {
#[derive(Debug, Clone)]
pub enum ShErrKind {
IoErr(io::ErrorKind),
InvalidOpt,
SyntaxErr,
ParseErr,
InternalErr,
@@ -421,6 +420,7 @@ impl Display for ShErrKind {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let output = match self {
Self::IoErr(e) => &format!("I/O Error: {e}"),
Self::InvalidOpt => &format!("Invalid option"),
Self::SyntaxErr => "Syntax Error",
Self::ParseErr => "Parse Error",
Self::InternalErr => "Internal Error",

View File

@@ -29,7 +29,7 @@ impl Display for ShedLogLevel {
pub fn log_level() -> ShedLogLevel {
use ShedLogLevel::*;
let level = std::env::var("FERN_LOG_LEVEL").unwrap_or_default();
let level = std::env::var("SHED_LOG_LEVEL").unwrap_or_default();
match level.to_lowercase().as_str() {
"error" => ERROR,
"warn" => WARN,