Package compiler app with two entry points

I have a file foo.jl with two functions. One is to review ods files, and then if they are all accepable the other is to summarize them. It would be easy to put this code in a module and then in principle I should be able to use package compiler to create an app. The package compiler documentation suggests:

function julia_main()::Cint
  # do something based on ARGS?
  return 0 # if things finished successfully
end

I think this means that I would need to modify this to have one entry point to look something like this:

function julia_main(path::String, division::String; function::String="review")::Cint
  if function = "review"
    review(path, division)
  elseif function = "summarize"
    summarize(path, division)
  else
    error("function can only be "review" or "summarize"")  # I have to figure out how to display the quotes as well
    return 1   # not sure what I should return for an error
  end
  return 0 # if things finished successfully
end

Some experienced expert tips will be appreciated!

Not sure this qualifies as an “experienced expert tip”, but I’d say you’re on the right track, except your main function shouldn’t take regular arguments. Instead, if should look at what’s been provided in the command-line, which is stored in the ARGS global variable. So your example would rather look like:

function julia_main()::Cint
    # Very crude handling of command-line args
    path = ARGS[1]
    division = ARGS[2]
    fun = get(ARGS, 3, "review") # default value if less than 3 args are specified in the command-line

    if fun == "review"
        review(path, division)
    elseif fun == "summarize"
        summarize(path, division)
    else
        # I'd use backquotes, but double quotes can be escaped
        error("fun can only be `review` or \"summarize\"")

        return 1 # non-zero signals an error
    end
    return 0 # if things finished successfully
end