cli

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: MIT Imports: 1 Imported by: 1

README

CLI

CLI app based on Cobra library.

Create New CLI App

import "github.com/bopher/cli"
app := cli.NewCLI("myApp", "My App Description")

Usage

CLI interface contains following methods:

AddCommand

Add new command to cli

// Signature:
AddCommand(cmd *cobra.Command)
RootCommand

Return pointer to cli root command

// Signature:
RootCommand() *cobra.Command
Run

Run cli

// Signature:
Run()

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

type CLI interface {
	// AddCommand add new command to cli
	AddCommand(cmd *cobra.Command)
	// RootCommand return pointer to cli root command
	RootCommand() *cobra.Command
	// Run cli
	Run()
}

CLI interface

func NewCLI

func NewCLI(name string, desc string) CLI

NewCLI create new cli app

Jump to

Keyboard shortcuts

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