api

package
v0.0.0-...-873fb03 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RootName = "rit"

	CoreCmdsDesc = "core commands:"
)

Variables

View Source
var (
	CoreCmds = Commands{
		"root_add":                   {Parent: "root", Usage: "add"},
		"root_add_repo":              {Parent: "root_add", Usage: "repo"},
		"root_add_workspace":         {Parent: "root_add", Usage: "workspace"},
		"root_completion":            {Parent: "root", Usage: "completion"},
		"root_completion_bash":       {Parent: "root_completion", Usage: "bash"},
		"root_completion_zsh":        {Parent: "root_completion", Usage: "zsh"},
		"root_completion_fish":       {Parent: "root_completion", Usage: "fish"},
		"root_completion_powershell": {Parent: "root_completion", Usage: "powershell"},
		"root_delete":                {Parent: "root", Usage: "delete"},
		"root_delete_env":            {Parent: "root_delete", Usage: "env"},
		"root_delete_repo":           {Parent: "root_delete", Usage: "repo"},
		"root_delete_workspace":      {Parent: "root_delete", Usage: "workspace"},
		"root_delete_formula":        {Parent: "root_delete", Usage: "formula"},
		"root_delete_credential":     {Parent: "root_delete", Usage: "credential"},
		"root_help":                  {Parent: "root", Usage: "help"},
		"root_init":                  {Parent: "root", Usage: "init"},
		"root_list":                  {Parent: "root", Usage: "list"},
		"root_list_repo":             {Parent: "root_list", Usage: "repo"},
		"root_list_credential":       {Parent: "root_list", Usage: "credential"},
		"root_list_formula":          {Parent: "root_list", Usage: "formula"},
		"root_list_workspace":        {Parent: "root_list", Usage: "workspace"},
		"root_set":                   {Parent: "root", Usage: "set"},
		"root_set_env":               {Parent: "root_set", Usage: "env"},
		"root_set_credential":        {Parent: "root_set", Usage: "credential"},
		"root_set_repo-priority":     {Parent: "root_set", Usage: "repo-priority"},
		"root_set_formula-runner":    {Parent: "root_set", Usage: "formula-runner"},
		"root_show":                  {Parent: "root", Usage: "show"},
		"root_show_env":              {Parent: "root_show", Usage: "env"},
		"root_show_formula-runner":   {Parent: "root_show", Usage: "formula-runner"},
		"root_create":                {Parent: "root", Usage: "create"},
		"root_create_formula":        {Parent: "root_create", Usage: "formula"},
		"root_update":                {Parent: "root", Usage: "update"},
		"root_update_repo":           {Parent: "root_update", Usage: "repo"},
		"root_update_workspace":      {Parent: "root_update", Usage: "workspace"},
		"root_build":                 {Parent: "root", Usage: "build"},
		"root_build_formula":         {Parent: "root_build", Usage: "formula"},
		"root_upgrade":               {Parent: "root", Usage: "upgrade"},
		"root_tutorial":              {Parent: "root", Usage: "tutorial"},
		"root_metrics":               {Parent: "root", Usage: "metrics"},
		"root_rename":                {Parent: "root", Usage: "rename"},
		"root_rename_formula":        {Parent: "root_rename", Usage: "formula"},
	}
)

Functions

func RitchieHomeDir

func RitchieHomeDir() string

RitchieHomeDir returns the home dir of the ritchie

func UserHomeDir

func UserHomeDir() string

UserHomeDir returns the home dir of the user, if rit is called with sudo, it returns the same path

Types

type ByLen

type ByLen []CommandID

func (ByLen) Len

func (a ByLen) Len() int

func (ByLen) Less

func (a ByLen) Less(i, j int) bool

func (ByLen) Swap

func (a ByLen) Swap(i, j int)

type Command

type Command struct {
	Parent         string `json:"parent"`
	Usage          string `json:"usage"`
	Help           string `json:"help,omitempty"`
	LongHelp       string `json:"longHelp,omitempty"`
	Formula        bool   `json:"formula,omitempty"`
	Repo           string `json:"-"`
	RepoNewVersion string `json:"-"`
}

Command type

type CommandID

type CommandID string

func (CommandID) String

func (id CommandID) String() string

type Commands

type Commands map[CommandID]Command

type TermInputType

type TermInputType int

TermInputType represents the source of the inputs will be read

const (
	// Prompt input
	Prompt TermInputType = iota
	// Stdin input
	Stdin
	// Flag input
	Flag
)

func (TermInputType) String

func (t TermInputType) String() string

func (TermInputType) ToLower

func (t TermInputType) ToLower() string

ToLower converts the input type to lower case

Jump to

Keyboard shortcuts

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