diff --git a/cmd.go b/cmd.go index 0130def7..721ef4a6 100644 --- a/cmd.go +++ b/cmd.go @@ -6,6 +6,7 @@ import ( "fmt" "io" "os" + "os/exec" "path/filepath" "strconv" "strings" @@ -488,3 +489,22 @@ func complete() error { _, err = io.Copy(os.Stdout, in) return err } + +// PassToPacman outsorces execution to pacman binary without modifications. +func passToPacman(parser *argParser) error { + var cmd *exec.Cmd + args := make([]string, 0) + + if parser.needRoot() { + args = append(args, "sudo") + } + + args = append(args, "pacman") + args = append(args, parser.formatArgs()...) + + cmd = exec.Command(args[0], args[1:]...) + + cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr + err := cmd.Run() + return err +} diff --git a/config.go b/config.go index 53710719..ffe69328 100644 --- a/config.go +++ b/config.go @@ -194,23 +194,4 @@ func continueTask(s string, def string) (cont bool) { } return true -} - -// PassToPacman outsorces execution to pacman binary without modifications. -func passToPacman(parser *argParser) error { - var cmd *exec.Cmd - args := make([]string, 0) - - if parser.needRoot() { - args = append(args, "sudo") - } - - args = append(args, "pacman") - args = append(args, parser.formatArgs()...) - - cmd = exec.Command(args[0], args[1:]...) - - cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr - err := cmd.Run() - return err -} +} \ No newline at end of file