Skip to content

Commit 462e2ef

Browse files
committed
Fix
1 parent e619f3b commit 462e2ef

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/core/builtins/command.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use crate::elements::command::simple::SimpleCommand;
55
use crate::elements::io::pipe::Pipe;
66
use crate::utils::{arg, file};
7-
use crate::{error, proc_ctrl, ShellCore};
7+
use crate::{error, proc_ctrl, ShellCore, utils};
88

99
pub fn builtin(core: &mut ShellCore, args: &[String]) -> i32 {
1010
if args.len() <= 1 {
@@ -27,7 +27,14 @@ fn command_v(words: &[String], core: &mut ShellCore, large_v: bool) -> i32 {
2727
let mut return_value = 1;
2828

2929
for com in words.iter() {
30-
if core.db.has_array_value("BASH_ALIASES", com) {
30+
if utils::reserved(com) {
31+
return_value = 0;
32+
match large_v {
33+
true => println!("{} is a shell keyword", &com),
34+
false => println!("{}", &com),
35+
}
36+
} else if core.db.has_array_value("BASH_ALIASES", com) {
37+
return_value = 0;
3138
let alias = core.db.get_elem("BASH_ALIASES", com).unwrap();
3239
match large_v {
3340
true => println!("{} is aliased to `{}'", &com, &alias),

src/core/builtins/type_.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,11 @@ fn type_t(core: &mut ShellCore, args: &[String]) -> i32 {
6161
}
6262

6363
fn type_t_sub(core: &mut ShellCore, com: &String) -> i32 {
64+
/*
6465
if core.db.has_array_value("BASH_ALIASES", com) {
6566
println!("alias");
6667
return 0;
67-
}
68+
}*/
6869
if utils::reserved(com) {
6970
println!("keyword");
7071
return 0;

0 commit comments

Comments
 (0)