- struct thread_data *td, *td_parent;
- const char **o;
- int i, in_global = 1;
- char jobname[32];
-
- dprint(FD_PARSE, "loading profile '%s'\n", profile);
-
- for (i = 0; i < PROFILE_END; i++) {
- if (!strcmp(profile, profiles[i]))
- break;
- }
-
- if (i == PROFILE_END) {
- log_err("fio: unknown profile '%s'\n", profile);
- return 1;
- }
-
- o = fio_prof_strings[i];
- if (!o)
- return 0;
-
- i = 0;
- td_parent = td = NULL;
- while (o[i]) {
- if (!strncmp(o[i], "name", 4)) {
- in_global = 0;
- if (td)
- add_job(td, jobname, 0);
- td = NULL;
- sprintf(jobname, "%s", o[i] + 5);
- }
- if (in_global && !td_parent)
- td_parent = get_new_job(1, &def_thread);
- else if (!in_global && !td) {
- if (!td_parent)
- td_parent = &def_thread;
- td = get_new_job(0, td_parent);
+ char *ostr = cmd_optstr;
+ int i, c;
+
+ c = i = 0;
+ while (l_opts[i].name) {
+ ostr[c++] = l_opts[i].val;
+ if (l_opts[i].has_arg == required_argument)
+ ostr[c++] = ':';
+ else if (l_opts[i].has_arg == optional_argument) {
+ ostr[c++] = ':';
+ ostr[c++] = ':';