diff --git a/completers/yt-dlp_completer/cmd/root.go b/completers/yt-dlp_completer/cmd/root.go index 6b5ae75aec..1f825058a2 100644 --- a/completers/yt-dlp_completer/cmd/root.go +++ b/completers/yt-dlp_completer/cmd/root.go @@ -285,7 +285,7 @@ func init() { "config-locations": carapace.ActionFiles(), "convert-subs": ytdlp.ActionSubtitleFormats(), "convert-thumbnails": ytdlp.ActionThumbnailFormats(), - "cookies-from-browser": carapace.ActionValues("brave", "chrome", "chromium", "edge", "firefox", "opera", "safari", "vivaldi"), + "cookies-from-browser": ytdlp.ActionBrowsers(), "date": time.ActionDate(), "dateafter": time.ActionDate(), "datebefore": time.ActionDate(), @@ -312,8 +312,16 @@ func init() { }), "load-info-json": carapace.ActionFiles(), "merge-output-format": ytdlp.ActionOutputFormats().UniqueList("/"), - "recode-video": ytdlp.ActionVideoFormats(), - "remux-video": ytdlp.ActionVideoFormats(), + "print-to-file": carapace.ActionCallback(func(c carapace.Context) carapace.Action { + switch len(c.Parts) { + case 1: + return carapace.ActionFiles() + default: + return carapace.ActionValues() + } + }), + "recode-video": ytdlp.ActionVideoFormats(), + "remux-video": ytdlp.ActionVideoFormats(), "sponsorblock-mark": carapace.ActionMultiParts(",", func(c carapace.Context) carapace.Action { a := ytdlp.ActionSponsorblockCategories() for index, part := range c.Parts { diff --git a/pkg/actions/tools/ytdlp/browser.go b/pkg/actions/tools/ytdlp/browser.go new file mode 100644 index 0000000000..cf7d5b0836 --- /dev/null +++ b/pkg/actions/tools/ytdlp/browser.go @@ -0,0 +1,20 @@ +package ytdlp + +import "github.com/rsteube/carapace" + +// ActionBrowsers completes browsers +// +// brave +// chrome +func ActionBrowsers() carapace.Action { + return carapace.ActionValues( + "brave", + "chrome", + "chromium", + "edge", + "firefox", + "opera", + "safari", + "vivaldi", + ).Tag("browsers") +}