Package-Compiler stops compile process because of arguments missing

Hello,

I developed a program that requires a few arguments and when the program starts, it checks whether the correct arguments were given and if not, then it raises an exception. For example:

# Read the arguments given to the Julia process.
argument_list = ARGS

    # Get the task type from the argument (parameter) given to the program when it was started.
    if length(argument_list) >= 2 && length(strip(argument_list[2])) >= 1 && is_valid_task_type(string(strip(argument_list[2])))
        const TASK_TYPE = string(strip(argument_list[2]))
    else
        throw(ArgumentError("No task type given as argument! The task type must be the FIRST argument given to the process!"))
    end

My problem is that when I compile my program to create a stand-alone .EXE-Application for Windows, then the compilation process stops and reports that an ArgumentError occured. It occurs because the arguments are missing. How shall I tell the package compiler to use arguments when compiling my program?

Of course, I could use

println("No task type given as argument! The task type must be the FIRST argument given to the process!")

instead of

throw(ArgumentError("No task type given as argument! The task type must be the FIRST argument given to the process!"))

However, it would be better to use ArgumentError because it is the correct type of exception.

I compile my program by using these commands:

using PackageCompiler
create_app("MyProgramName", "MyProgramNameCompiled"; precompile_execution_file = "MyProgramNamer/precompile_app.jl")

precompile_app.jl contains only this here:

using MyProgramName

MyProgramName.julia_main()

I am using PackageCompiler v2.1.7 and Julia 1.8.5. The operating system is Windows 10.

Thanks for any advices in advance!

Kind regards,
Miroslav Stimac