main: raise error when board name is provided but not found
This commit is contained in:
parent
3b15a633fa
commit
8df01663ff
|
|
@ -97,8 +97,13 @@ int main(int argc, char **argv)
|
||||||
if (args.prg_type == Device::WR_FLASH)
|
if (args.prg_type == Device::WR_FLASH)
|
||||||
cout << "write to flash" << endl;
|
cout << "write to flash" << endl;
|
||||||
|
|
||||||
if (args.board[0] != '-' && board_list.find(args.board) != board_list.end()) {
|
if (args.board[0] != '-') {
|
||||||
board = &(board_list[args.board]);
|
if (board_list.find(args.board) != board_list.end()) {
|
||||||
|
board = &(board_list[args.board]);
|
||||||
|
} else {
|
||||||
|
printError("Error: cannot find board \'" +args.board + "\'");
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if a board name is specified try to use this to determine cable */
|
/* if a board name is specified try to use this to determine cable */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue