Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Absorb = Command{"absorb", "Merge the changes in another branch into this one", execAbsorb, printAbsorbHelp}
var Commit = Command{"commit", "Make a commit", execCommit, printCommitHelp}
var Delete = Command{"delete", "Deletes a commit or branch", execDelete, printDeleteHelp}
var Init = Command{"create", "Create a repo", execCreate, printCreateHelp}
var Line = Command{"line", "Create a new line", execLine, printLineHelp}
var Patch = Command{"patch", "Will patch the last commit with the current work", execPatch, printPatchHelp}
var Resolve = Command{"resolve", "Commit resolved conflicts after absorb", execResolve, printResolveHelp}
var Status = Command{"status", "Show the state of the repo", execStatus, printStatusHelp}
var Switch = Command{"switch", "Switch to a different line", execSwitch, printSwitchHelp}
var Sync = Command{"sync", "Sync with remote repo or something like that", execSync, printSyncHelp}
var Template = Command{"template", "Show you how a command should look", execTemplate, printTemplateHelp}
Functions ¶
func ParseArgs ¶
Parse the arguments given to Metro on the command line. args: The arguments to parse. allOptions: The list of possible options.
All positional arguments must come before all Option arguments. Options may have a value associated with them, in the form "--key=value" or "--key value". Each Option has a long version, prefixed with --, and a short version, prefixed with -. Using the wrong prefix will result in the Option not being recognised. The --help and -h flags are excluded from the options; instead hashHelpFlag is set. The Name of the executable is excluded from the returned arguments.
Returns: positionals, options, hasHelpFlag, error options maps the long Name of each Option to its value, even if a Contraction is used. Prefix -'s are excluded.
Will return an error if: - An unknown Option is given - An Option that requires a value isn't given one - An Option that doesn't require a value is given one - A positional argument is found after an Option (interpreted as a value with no corresponding Option flag)