doccmd

package
v0.0.0-...-9c55465 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ChtHost = "https://cht.sh/"
View Source
const RandTopic = ":random"

Variables

View Source
var DocumentCmd = &gcli.Command{
	Name:    "doc",
	Desc:    "how to use for common tools or common commands",
	Aliases: []string{"htu", "docs"},
	Subs: []*gcli.Command{
		SearchCmd,
		LinuxCmd,
		InstallCmd,
		TopicListCmd,
	},
	Config: func(c *gcli.Command) {
		c.AddArg("topic", "search document on the topic")
	},
	Func: func(c *gcli.Command, args []string) error {
		topic := c.Arg("topic").String()
		if topic == "" {
			return c.ShowHelp()
		}

		return errorx.New("TODO")
	},
}

DocumentCmd instance

View Source
var InstallCmd = &gcli.Command{
	Name:    "install",
	Aliases: []string{"ins", "add"},
	Desc:    "install new documents topic from git repository(eg: github)",
	Config: func(c *gcli.Command) {

	},
	Func: func(c *gcli.Command, _ []string) error {
		return errorx.New("TODO")
	},
}

InstallCmd instance

View Source
var LinuxCmd = &gcli.Command{
	Name:    "linux",
	Aliases: []string{"lin", "linux-cmd"},
	Desc:    "document for use linux commands",
	Config: func(c *gcli.Command) {

	},
	Func: func(c *gcli.Command, _ []string) error {
		return errors.New("TODO")
	},
}

LinuxCmd instance https://github.com/jaywcjlove/linux-command/tree/master/command linux commands zh-CN documents

View Source
var SearchCmd = &gcli.Command{
	Name:    "search",
	Aliases: []string{"find"},
	Desc:    "search document for use linux commands",
	Config: func(c *gcli.Command) {

	},
	Func: func(c *gcli.Command, _ []string) error {
		return errorx.New("TODO")
	},
}

SearchCmd instance

View Source
var TopicListCmd = &gcli.Command{
	Name:    "list-topics",
	Aliases: []string{"list-topic", "lt"},
	Desc:    "list installed document topics",
	Config: func(c *gcli.Command) {

	},
	Func: func(c *gcli.Command, _ []string) error {
		return errorx.New("TODO")
	},
}

TopicListCmd instance

Functions

func NewCheatCmd

func NewCheatCmd() *gcli.Command

NewCheatCmd instance

Query cheat for development

Example:

curl cheat.sh/tar
curl cht.sh/curl
curl https://cheat.sh/rsync
curl https://cht.sh/php

curl cht.sh/go/:list
curl cht.sh/go/reverse+a+list
curl cht.sh/python/random+list+elements
curl cht.sh/js/parse+json
curl cht.sh/lua/merge+tables
curl cht.sh/clojure/variadic+function

Types

type Topic

type Topic struct {
	Name string
	Desc string
	Type string // file, git, dir
	Path string
}

Topic struct

Jump to

Keyboard shortcuts

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