-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Hi @albmac .
Short options: -d, -e, -i, -o. See https://github.com/ImageProcessing-ElectronicPublications/jpeg-decomp .
struct option long_options[] =
{
{"decode", no_argument, &decode, 'd'},
{"encode", no_argument, &encode, 'e'},
{"fin", required_argument, 0, 'i'},
{"fout", required_argument, 0, 'o'},
{0, 0, 0, 0}
};
while ((c = getopt_long (argc, argv, "dei:o:",long_options,&option_index)) != -1)
switch (c)
{
case 'd': //decode
decode = 1;
break;
case 'e': //encode
encode = 1;
break;
case 'i': //fin
strncpy(filein,optarg,sizeof(filein)-1);
break;
case 'o': //fout
strncpy(fileout,optarg,sizeof(fileout)-1);
break;
case '?':
fprintf (stderr,"option error");
return;
default:
break;
}
...
if(encode==0&&decode==0)
{
printf("Usage:\n");
printf("%s --decode or --encode --fin <file> --fout <file>\n", argv[0]);
printf("or:\n");
printf("%s -d|-e -i <file> -o <file>\n", argv[0]);
return;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels