uymas

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2018 License: Apache-2.0 Imports: 0 Imported by: 0

README

uymas

项目介绍

go 语言工具库 go-version: v1.11.1

  • source
    • bin 命令行解析工具

安装

# github
$ go get -u  github.com/conero/uymas

bin

命令行行语法

$ [command] [<options>]

$ [command] [<options>]
# [<options>] 格式如下

# 1. 配置参数;全称以及简写
--set[=true]
-short[=true]

# 2. 二级命令(紧接着 [command])
$ [command] [<sub-command>] [<options>]

使用

package main

import (
	"fmt"
	"github.com/conero/uymas/bin"
)
// 命令 test
type Test struct {
	bin.Command
}

func (test *Test) Run ()  {
	fmt.Println("ffff.")
}
// 命令 yang
type Yang struct {
	bin.Command
}


func main() {
	//router := &bin.Router{}
	//bin.Register("test", &Test{})
	//bin.Register("yang", &Yang{})
	//bin.Adapter(router)
	bin.RegisterApps(map[string]interface{}{
		"test": &Test{},
		"yang": &Yang{},
	})
	bin.Run()
}

Documentation

Index

Constants

View Source
const (
	Version = "0.2.0"
	Release = "20181106"
	Author  = "Joshua Conero"
	Name    = "uymas"
)

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
str

Jump to

Keyboard shortcuts

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