Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
correct exit code (#6744)
  • Loading branch information
Cristy committed Sep 28, 2023
1 parent 086a539 commit ffe9809
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 8 deletions.
7 changes: 6 additions & 1 deletion MagickWand/compare.c
Expand Up @@ -292,7 +292,12 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info,
}
}
if (argc < 3)
return(CompareUsage());
{
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"MissingArgument","%s","");
(void) CompareUsage();
return(MagickFalse);
}
difference_image=NewImageList();
similarity_image=NewImageList();
dissimilarity_threshold=DefaultDissimilarityThreshold;
Expand Down
7 changes: 6 additions & 1 deletion MagickWand/composite.c
Expand Up @@ -488,7 +488,12 @@ WandExport MagickBooleanType CompositeImageCommand(ImageInfo *image_info,
}
}
if (argc < 4)
return(CompositeUsage());
{
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"MissingArgument","%s","");
(void) CompositeUsage();
return(MagickFalse);
}
GetCompositeOptions(image_info,&composite_options);
filename=(char *) NULL;
format="%w,%h,%m";
Expand Down
7 changes: 6 additions & 1 deletion MagickWand/conjure.c
Expand Up @@ -168,7 +168,12 @@ WandExport MagickBooleanType ConjureImageCommand(ImageInfo *image_info,
if (IsEventLogging() != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
if (argc < 2)
return(ConjureUsage());
{
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"MissingArgument","%s","");
(void) ConjureUsage();
return(MagickFalse);
}
image=NewImageList();
number_images=0;
option=(char *) NULL;
Expand Down
7 changes: 6 additions & 1 deletion MagickWand/convert.c
Expand Up @@ -558,7 +558,12 @@ WandExport MagickBooleanType ConvertImageCommand(ImageInfo *image_info,
}
}
if (argc < 3)
return(ConvertUsage());
{
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"MissingArgument","%s","");
(void) ConvertUsage();
return(MagickFalse);
}
filename=(char *) NULL;
format="%w,%h,%m";
j=1;
Expand Down
7 changes: 6 additions & 1 deletion MagickWand/identify.c
Expand Up @@ -241,7 +241,12 @@ WandExport MagickBooleanType IdentifyImageCommand(ImageInfo *image_info,
}
}
if (argc < 2)
return(IdentifyUsage());
{
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"MissingArgument","%s","");
(void) IdentifyUsage();
return(MagickFalse);
}
count=0;
format=NULL;
j=1;
Expand Down
7 changes: 6 additions & 1 deletion MagickWand/mogrify.c
Expand Up @@ -3789,7 +3789,12 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info,
}
}
if (argc < 2)
return(MogrifyUsage());
{
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"MissingArgument","%s","");
(void) MogrifyUsage();
return(MagickFalse);
}
format=(char *) NULL;
path=(char *) NULL;
global_colormap=MagickFalse;
Expand Down
7 changes: 6 additions & 1 deletion MagickWand/montage.c
Expand Up @@ -327,7 +327,12 @@ WandExport MagickBooleanType MontageImageCommand(ImageInfo *image_info,
}
}
if (argc < 3)
return(MontageUsage());
{
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"MissingArgument","%s","");
(void) MontgagUsage();
return(MagickFalse);
}
format="%w,%h,%m";
first_scene=0;
j=1;
Expand Down
7 changes: 6 additions & 1 deletion MagickWand/stream.c
Expand Up @@ -224,7 +224,12 @@ WandExport MagickBooleanType StreamImageCommand(ImageInfo *image_info,
}
}
if (argc < 3)
return(StreamUsage());
{
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"MissingArgument","%s","");
(void) StreamUsage();
return(MagickFalse);
}
format="%w,%h,%m";
(void) format;
j=1;
Expand Down

0 comments on commit ffe9809

Please sign in to comment.