- if (argc == 3) {
- if (isdigit(*(argv[2])))
- type = strtoul(argv[2], 0, 0);
+ if (isdigit(*(argv[2])))
+ type = strtoul(argv[2], 0, 0);
+ else {
+ switch( component_type = select_component_type(argv[2])) {
+ case 0:
+ type = CBFS_COMPONENT_STAGE;
+ break;
+ case 1:
+ type = CBFS_COMPONENT_PAYLOAD;
+ break;
+ case 2:
+ type = CBFS_COMPONENT_OPTIONROM;
+ break;
+ case 3:
+ type = CBFS_COMPONENT_DELETED;
+ break;
+ case 4:
+ type = CBFS_COMPONENT_NULL;
+ break;
+ default:
+ ERROR("Unrecognized component type %s.\nValid options are: stage, payload, optionrom, deleted, free.\n", argv[2]);
+ return -1;
+ }