command

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 34 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "cuni",
	Short: "Central University CLI Tool",
	Long: `cuni is a command-line tool for interacting with Central University services.
It provides access to courses, authentication, and data synchronization.`,
	SilenceUsage:  true,
	SilenceErrors: true,
	PersistentPreRun: func(cmd *cobra.Command, _ []string) {
		cmdStartTime = time.Now()
		cmdPath = cmd.CommandPath()
		cmd.Flags().Visit(func(f *pflag.Flag) {
			cmdFlags = append(cmdFlags, f.Name)
		})
	},
	PersistentPostRun: func(_ *cobra.Command, _ []string) {
		telemetry.Default().CommandExecuted(telemetry.CommandEvent{
			Command:  cmdPath,
			Flags:    cmdFlags,
			Duration: time.Since(cmdStartTime),
			Success:  true,
		})
		update.CheckForUpdate()
		telemetry.Default().Flush(telemetry.DefaultFlushTimeout)
	},
}

Functions

func ReportUsageError added in v0.1.5

func ReportUsageError()

ReportUsageError records a command that never reached PersistentPreRun — unknown command, bad flags. Called from main on RootCmd.Execute error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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