GreycLab / gmic

GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing
Other
66 stars 11 forks source link

Enable optional cli_end command. #45

Closed Reptorian1125 closed 4 months ago

Reptorian1125 commented 4 months ago

This would be useful when importing .gmic script. Just before the End G'MIC interpreter you can make G'MIC execute __main__ or whatever you want to call to execute from the imported G'MIC script.

EDIT: Easiest way seems to be checking if command cli_end exists and to execute it right at the beginning of _display if it does.

EDIT 2: Just as I mentioned in the forum, basically all that is needed for this to happen is inserting if ['$$cli_end']!=0 cli_end fi under _display right at the very beginning, and there you have a easy way to allow optional cli_end command.