[TRY 2] [2/3] extrac32: Add command-line parsing
Alexandre Julliard
julliard at winehq.org
Thu Oct 22 09:01:21 CDT 2009
Ilya Shpigor <shpigor at etersoft.ru> writes:
> + /* Parse options */
> + for(i = 0; i < argc; i++)
> + {
> + if (argv[i][0] == '/')
> + {
> + for(j = 0; j < sizeof(sFlags) / sizeof(sFlags[0]); j++)
> + if (!strcmpiW(argv[i], sFlags[j].wFlag))
> + {
> + comp |= sFlags[j].nFlag;
> + goto next;
> + }
> + }
> + next:
> + continue;
> + }
> +
> + if ((comp & CMD_FLAGS) == EFLAGC) /* copy file */
> + {
> + WINE_FIXME("/C not implemented\n");
> + } else if ((comp & CMD_FLAGS) == EFLAGD) /* display CAB archive */
> + {
> + WINE_FIXME("/D not implemented\n");
> + } else if ((comp & CMD_FLAGS) == EFLAGE) /* extract CAB archive */
> + {
> + WINE_FIXME("/E not implemented\n");
> + } else if ((comp & CMD_FLAGS) == 0) /* expand mode */
> + {
> + WINE_FIXME("Expand mode not implemented\n");
> + }
That parsing approach is not really appropriate here, the options are
not just a bunch of flags, there are options with arguments, mutually
exclusive modes, etc. Some sort of switch() statement would be more
natural.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list