cmd

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Copyright © 2024 Victor Hang

Copyright © 2024 Victor Hang

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "ytui",
	Short: "YouTube TUI browser.",
	Long: `
ytui is a TUI tool that allows users to browse and search YouTube videos and play them in their local player.
Navigate through search results, subscribed channels, and watch history using an interactive interface.
The configuration file is autogenerated on first run at *$HOME/.config/ytui/config.yaml*`,
	PersistentPreRun: func(cmd *cobra.Command, args []string) {

		initConfig()
	},
	Run: func(cmd *cobra.Command, args []string) {
		defer func() {
			if r := recover(); r != nil {
				if utils.Logger != nil {
					utils.Logger.Error("Application panicked", zap.Any("panic", r))
				}
				fmt.Printf("\n❌ Application crashed. Check the log file for details.\n")
				os.Exit(1)
			}
		}()

		if versionFlag {
			fmt.Printf("%s", version)
		} else {
			ui.Menu()
		}
	},
}

rootCmd represents the base command when called without any subcommands

Functions

func Execute

func Execute()

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL