Skip to content
Snippets Groups Projects
Commit b0ba1ed0 authored by Jakob Hellermann's avatar Jakob Hellermann Committed by Michael Aaron Murphy
Browse files

feat: allow use of empty 'alias' (print if exists)

parent cc653ff9
No related branches found
No related tags found
No related merge requests found
......@@ -75,7 +75,11 @@ pub fn builtin_alias(args: &[types::Str], shell: &mut Shell<'_>) -> Status {
}
Binding::ListEntries => print_list(shell.variables()),
Binding::KeyOnly(key) => {
return Status::error(format!("ion: please provide value for alias '{}'", key));
if let Some(alias) = shell.variables().get(&key) {
println!("alias {}='{}'", key, alias);
} else {
return Status::error(format!("ion: alias '{}' not found", key));
}
}
}
Status::SUCCESS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment