Skip to content

Conversation

cardil
Copy link

@cardil cardil commented Sep 16, 2022

Fixes #445

I'm introducing two functions Run and HandleParseError which allow users to customize the Invocation after it is parsed.

For example:

inv, cmd, err := Parse(stderr, stdout, args)
if retcode, doExit := HandleParseError(err, stderr); doExit {
  return retcode
}
inv.Stdin = stdin

# example customization
inv.WorkDir = ".." 
inv.Dir = "."

return Run(inv, cmd)

@cardil cardil force-pushed the feature/decouple-parse-run branch from 2744c9f to e864580 Compare September 18, 2022 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Allow to customize mage's Main func
1 participant