On Wed, Apr 29, 2020 at 08:40:10PM +0200, Markus Elfring wrote: > > I am trying to exit spatch with a non-zero exit status when required > > changes have been found. > > I got used to the interpretation that a zero exit status > should indicate a successful execution of the program.
I agree, but I guess what successful execution means is a matter of perspective. For example, grep returns a non-zero exit status when it doesn't match anything. Yet, I generally consider that a successful execution when I use grep. > > > > @finalize:python@ > > @@ > > exit(cnt) > > > > where cnt is incremented by another Python rule everytime a required > > change is found. > > I suggest to handle the desired search result counter > by an other data processing interface. > How would you like to treat program execution failures otherwise? I'm trying to run SmPL programs as part of a CI pipeline, so execution failure and (buggy) code pattern not found really mean the same in the end: a human needs to take a look :-) I understand that is not a common use case and I'm fine using a workaround. Just wanted to check I wasn't missing something obvious. Cheers, Paul > > Regards, > Markus _______________________________________________ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci