Guild not getting flags and scalars when using __main__

So my code has the following structure:

class definitions
function definitions

if name == “main”:
class call
function call

I think Guild is not recognizing the flags and scalars because they’re happening inside the class and function calls. Is there a way for Guild to parse them without modifying the code?

Can you provide a more detailed example?