cli

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DebugProgArg = ProgArg{
	Name:  "Debug",
	Short: "d",
	Long:  "debug",
	Help:  "Enabled Debug output",
	Func: func(_ string) error {
		global.Cfg.Debug = true
		Dbg("Debug output enabled")
		return nil
	},
}
View Source
var HelpProgArg = ProgArg{
	Name:    "Help",
	Short:   "h",
	Long:    "help",
	Help:    "",
	HasData: false,
	Func:    help,
}
View Source
             ______     __                             
            /\  __ \   /\ \                            
            \ \  __ \  \ \ \                           
             \ \_\ \_\  \ \_\                          
              \/_/\/_/   \/_/                          
 ______     __  __     ______     __         __        
/\  ___\   /\ \_\ \   /\  ___\   /\ \       /\ \       
\ \___  \  \ \  __ \  \ \  __\   \ \ \____  \ \ \____  
 \/\_____\  \ \_\ \_\  \ \_____\  \ \_____\  \ \_____\ 
  \/_____/   \/_/\/_/   \/_____/   \/_____/   \/_____/ 

  by Sett   {{https://github.com/Sett17/ai-shell}}::green
`)
View Source
var ProgArgs = []ProgArg{}
View Source
var VersionProgArg = ProgArg{
	Name:    "Version",
	Short:   "v",
	Long:    "version",
	Help:    "Show the version of this program",
	HasData: false,
	Func: func(_ string) error {
		cfmt.Printf("AI-shell version %s\n", global.Version)
		os.Exit(0)
		return nil
	},
}

Functions

func Dbg

func Dbg(msg string)

func Error

func Error(err error, exit bool)

func Info

func Info(msg string)

func Parse

func Parse(args []string) (instruction string)

func ParseForDebug

func ParseForDebug(args []string)

func ParseForHelp

func ParseForHelp(args []string)

func ParseForVersion

func ParseForVersion(args []string)

func Separator

func Separator()

func Warning

func Warning(msg string)

Types

type ProgArg

type ProgArg struct {
	Name    string
	Short   string
	Long    string
	Help    string
	HasData bool

	Func progArgFunction
}

type Stopwatch

type Stopwatch struct {
	// contains filtered or unexported fields
}

func NewStopWatch

func NewStopWatch(interval time.Duration) Stopwatch

func (*Stopwatch) Reset

func (t *Stopwatch) Reset()

func (*Stopwatch) SetStartTimeAndStart

func (t *Stopwatch) SetStartTimeAndStart(time time.Time)

func (*Stopwatch) Start

func (t *Stopwatch) Start()

func (*Stopwatch) Stop

func (t *Stopwatch) Stop()

func (*Stopwatch) Update

func (t *Stopwatch) Update()

Jump to

Keyboard shortcuts

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