From 949781fa0a5f0654112b4f78558347ca991a89d3 Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Sat, 30 Jan 2021 11:33:31 +0100 Subject: Refactor lib/open to accept user provided arguments * Get rid of open_darwin It just lead to code duplication for a simple one string change. Instead we query it during initialization * Accept user provided arguments "open" on MacOS accepts things like -A to use a specific application Pass trough arguments the user provided in order to facilitate this * Refactor the function to a struct This makes it more convenient for the caller and avoids signatures like lib.OpenFile(nil, u.String(), nil) which are fairly unreadable --- commands/msg/unsubscribe.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'commands/msg') diff --git a/commands/msg/unsubscribe.go b/commands/msg/unsubscribe.go index 205a255..cf3e4a8 100644 --- a/commands/msg/unsubscribe.go +++ b/commands/msg/unsubscribe.go @@ -119,6 +119,5 @@ func unsubscribeMailto(aerc *widgets.Aerc, u *url.URL) error { } func unsubscribeHTTP(u *url.URL) error { - lib.OpenFile(u.String(), nil) - return nil + return lib.NewXDGOpen(u.String()).Start() } -- cgit 1.4.1-2-gfad0