Make fish_indent available as a builtin

This commit is contained in:
Fabian Boehm
2024-11-27 21:00:25 +01:00
parent 67eb0e8317
commit c7358d14c8
5 changed files with 1159 additions and 1184 deletions

View File

@@ -27,6 +27,7 @@
use fish::future::IsSomeAnd;
use fish::{
ast::Ast,
builtins::fish_indent,
builtins::fish_key_reader,
builtins::shared::{
BUILTIN_ERR_MISSING, BUILTIN_ERR_UNKNOWN, STATUS_CMD_OK, STATUS_CMD_UNKNOWN,
@@ -715,6 +716,8 @@ fn main() {
let p = Path::new(&name).file_name().and_then(|x| x.to_str());
if p == Some("fish_key_reader") {
return fish_key_reader::main();
} else if p == Some("fish_indent") {
return fish_indent::main();
}
}
PROGRAM_NAME.set(L!("fish")).unwrap();

File diff suppressed because it is too large Load Diff

1149
src/builtins/fish_indent.rs Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -18,6 +18,7 @@
pub mod eval;
pub mod exit;
pub mod fg;
pub mod fish_indent;
pub mod fish_key_reader;
pub mod function;
pub mod functions;

View File

@@ -241,6 +241,10 @@ struct BuiltinData {
name: L!("fg"),
func: fg::fg,
},
BuiltinData {
name: L!("fish_indent"),
func: fish_indent::fish_indent,
},
BuiltinData {
name: L!("fish_key_reader"),
func: fish_key_reader::fish_key_reader,