Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuichiueda committed Jan 15, 2025
1 parent 27432df commit 97c4859
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/builtins/parameter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,12 @@ pub fn declare(core: &mut ShellCore, args: &mut Vec<String>) -> i32 {

if args.contains(&"-a".to_string()) {
if ! utils::is_name(&name, core) {
return 1; //TODO: error message
let e = ExecError::InvalidName(name.to_string());
error::print_e(e, core);
return 1;
}
if let Err(e) = core.db.set_array(&name, vec![], None) {
let msg = format!("{:?}", &e);
error::print(&msg, core);
error::print_e(e, core);
return 1;
}

Expand Down

0 comments on commit 97c4859

Please sign in to comment.