root

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

This package includes code for initializing and running the `sweet` command. It defines the flags and subcommands for the CLI, handles processing arguments, and reading files.

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:     "sweet [file]",
	Long:    fmt.Sprintf("%s.\nRuns an interactive touch typing game, and prints the results.", tagline()),
	Args:    cobra.MaximumNArgs(1),
	Example: examples(),
	RunE: func(cmd *cobra.Command, args []string) error {
		exercise, err := exerciseFileFromArgs(cmd, args)
		if err != nil {
			return err
		}
		viewOptions, err := viewOptionsFromArgs(cmd, exercise.text)
		if err != nil {
			return err
		}
		run(exercise.name, exercise.text, viewOptions)
		return nil
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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