func main() { multicall.Add("acbuild-script", func() error { cmd := exec.Command("acbuild", append([]string{"script"}, os.Args[1:]...)...) cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr return cmd.Run() }) // check if acbuild is executed with a multicall command multicall.MaybeExec() cmdAcbuild.SetUsageFunc(func(cmd *cobra.Command) error { tabOut := new(tabwriter.Writer) tabOut.Init(os.Stdout, 0, 8, 1, '\t', 0) commandUsageTemplate.Execute(tabOut, cmd) tabOut.Flush() return nil }) // Make help just show the usage cmdAcbuild.SetHelpTemplate(`{{.UsageString}}`) err := cmdAcbuild.Execute() if cmdExitCode == 0 && err != nil { cmdExitCode = getErrorCode(errCobra) } os.Exit(cmdExitCode) }
func init() { mcEntrypoint = multicall.Add(multicallName, extractTarCommand) }
func init() { multicall.Add("acbuild-chroot", cmdACBuildChroot.Execute) }