cli

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2022 License: GPL-3.0 Imports: 6 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() {
		global.Dbg = true
		Dbg("Debug output enabled")
	},
}
View Source
var HelpProgArg = ProgArg{
	Name:  "Help",
	Short: "h",
	Long:  "help",

	Func: help,
}
View Source
   ________  _______   ___      ___ ________ ___  ___       _______
  |\   ___ \|\  ___ \ |\  \    /  /|\  _____\\  \|\  \     |\  ___ \
  \ \  \_|\ \ \   __/|\ \  \  /  / | \  \__/\ \  \ \  \    \ \   __/|
   \ \  \ \\ \ \  \_|/_\ \  \/  / / \ \   __\\ \  \ \  \    \ \  \_|/__
    \ \  \_\\ \ \  \_|\ \ \    / /   \ \  \_| \ \  \ \  \____\ \  \_|\ \
     \ \_______\ \_______\ \__/ /     \ \__\   \ \__\ \_______\ \_______\
      \|_______|\|_______|\|__|/       \|__|    \|__|\|_______|\|_______|
        by Sett   {{https://github.com/Sett17/Devfile}}::green
`)
View Source
var ProgArgs = []ProgArg{
	{
		Name:  "List",
		Short: "l",
		Long:  "list",
		Help:  "List all passed operations",
		Func:  list,
	},
	{
		Name:  "Info",
		Short: "i",
		Long:  "info",
		Help:  "Shows information about any operations, as well as the script",
		Func:  info,
	},
}
View Source
var VersionProgArg = ProgArg{
	Name:  "Version",
	Short: "v",
	Long:  "version",
	Help:  "Show the version of this program",
	Func: func() {
		cfmt.Printf("Devfile version %s\n", global.Version)
		os.Exit(0)
	},
}

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)

func ParseForDebug

func ParseForDebug(args []string)

func ParseForHelp

func ParseForHelp(args []string)

func ParseForVersion

func ParseForVersion(args []string)

func Separator

func Separator()

func Warning added in v1.2.0

func Warning(msg string)

Types

type ProgArg

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

	Func progArgFunction
}

Jump to

Keyboard shortcuts

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