cmd

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Hash = "development"
View Source
var RootCommand = &cobra.Command{
	Use:     "cocainate",
	Short:   "keep screen awake",
	Long:    "keep screen awake",
	Version: Version,
	Args: func(cmd *cobra.Command, args []string) error {
		if pid != 0 && duration == 0 {
			return errors.New("process poling interval must be provided via the -d flag")
		}
		return nil
	},
	RunE: func(cmd *cobra.Command, args []string) error {
		s := session.New(duration, pid)

		if err := s.Start(); err != nil {
			return err
		}

		if err := s.Wait(); err != nil {
			return err
		}

		if flag.Lookup("test.v") == nil {
			fmt.Print("\033[2K\r")
		}

		return nil
	},
}
View Source
var Version = "development"

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