From c4fec3dad05423755fded0394f22deed0a0aea65 Mon Sep 17 00:00:00 2001 From: morganamilo Date: Wed, 25 Jul 2018 03:45:34 +0100 Subject: [PATCH] Wrap -Sp Currently we do not handle -Sp, this leads to yay trying a proper install and failing. So instead pass it to pacman and exit. Ideally we would extend -Sp to include AUR packages but for now don't bother. --- cmd.go | 2 ++ parser.go | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cmd.go b/cmd.go index a1204aa0..c0f1f0e4 100644 --- a/cmd.go +++ b/cmd.go @@ -417,6 +417,8 @@ func handleSync() (err error) { } err = syncSearch(targets) + } else if cmdArgs.existsArg("p", "print", "print-format") { + err = show(passToPacman(cmdArgs)) } else if cmdArgs.existsArg("c", "clean") { err = syncClean(cmdArgs) } else if cmdArgs.existsArg("l", "list") { diff --git a/parser.go b/parser.go index cd91c68f..8fef7a8f 100644 --- a/parser.go +++ b/parser.go @@ -122,10 +122,6 @@ func (parser *arguments) needRoot() bool { return false } - if parser.existsArg("p", "print") { - return false - } - switch parser.op { case "D", "database": if parser.existsArg("k", "check") { @@ -145,6 +141,12 @@ func (parser *arguments) needRoot() bool { case "R", "remove": return true case "S", "sync": + if parser.existsArg("y", "refresh") { + return true + } + if parser.existsArg("p", "print", "print-format") { + return false + } if parser.existsArg("s", "search") { return false }