notcurses_lex_scalemode(): return 0 on success

pull/885/head
nick black 4 years ago
parent 733da37bb5
commit ce5484c13c
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -2352,8 +2352,10 @@ int notcurses_lex_scalemode(const char* op, ncscale_e* scalemode){
*scalemode = NCSCALE_SCALE;
}else if(strcasecmp(op, "none") == 0){
*scalemode = NCSCALE_NONE;
}else{
return -1;
}
return -1;
return 0;
}
const char* notcurses_str_scalemode(ncscale_e scalemode){

@ -138,7 +138,8 @@ auto handle_opts(int argc, char** argv, notcurses_options& opts,
break;
case 's':
if(notcurses_lex_scalemode(optarg, scalemode)){
std::cerr << "Scaling type should be one of stretch, scale, none" << std::endl;
std::cerr << "Scaling type should be one of stretch, scale, none (got "
<< optarg << ")" << std::endl;
usage(std::cerr, argv[0], EXIT_FAILURE);
}
break;

Loading…
Cancel
Save