mirror of
https://github.com/sajenim/rush.git
synced 2025-06-28 09:54:21 +08:00
update configuration key name
This commit is contained in:
parent
43156a7e8b
commit
5cf09c9b42
3 changed files with 3 additions and 3 deletions
2
rush.lua
2
rush.lua
|
@ -1,7 +1,7 @@
|
||||||
-- This table will hold the configuration.
|
-- This table will hold the configuration.
|
||||||
local config = {}
|
local config = {}
|
||||||
|
|
||||||
config.aliases = {
|
config.shellAliases = {
|
||||||
ls = "ls --color=auto",
|
ls = "ls --color=auto",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ pub fn help() {
|
||||||
|
|
||||||
println!();
|
println!();
|
||||||
println!("Customization Options:");
|
println!("Customization Options:");
|
||||||
println!(" aliases - Define custom aliases for commands");
|
println!(" shellAliases - Define custom aliases for commands");
|
||||||
|
|
||||||
println!();
|
println!();
|
||||||
println!("Note: This is a basic implementation. More features and options will be added in future versions.");
|
println!("Note: This is a basic implementation. More features and options will be added in future versions.");
|
||||||
|
|
|
@ -9,7 +9,7 @@ use mlua::prelude::*;
|
||||||
// Helper function for resolving aliases.
|
// Helper function for resolving aliases.
|
||||||
fn resolve_alias(config: &mlua::Table, cmd: &str) -> Option<String> {
|
fn resolve_alias(config: &mlua::Table, cmd: &str) -> Option<String> {
|
||||||
config
|
config
|
||||||
.get::<mlua::Table>("aliases")
|
.get::<mlua::Table>("shellAliases")
|
||||||
.ok()
|
.ok()
|
||||||
.and_then(|aliases| aliases.get::<String>(cmd).ok())
|
.and_then(|aliases| aliases.get::<String>(cmd).ok())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue