cmd

package
v0.0.0-...-4c1ad01 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuildCMD = &cli.Command{
	Name:      "build",
	Usage:     "Builds a book from its markdown files",
	ArgsUsage: "[dir]  \n\n\t [dir] Root directory for the book (Defaults to the current directory when omitted)",

	Flags: []cli.Flag{
		&cli.PathFlag{
			Name:    "dest-dir",
			Aliases: []string{"d"},
			Usage:   "Output `directory` for the book\n\tRelative paths are interpreted relative to the book's root directory.",
		},
		&cli.BoolFlag{
			Name:    "open",
			Aliases: []string{"o"},
			Usage:   "Opens the compiled book in a web browser",
		},
	},
	Action: func(ctx *cli.Context) error {
		fmt.Println("build")
		return nil
	},
}
View Source
var CleanCMD = &cli.Command{
	Name:      "clean",
	Usage:     "Deletes a built book",
	ArgsUsage: "[dir]  \n\n\t [dir] Root directory for the book (Defaults to the current directory when omitted)",

	Flags: []cli.Flag{
		&cli.PathFlag{
			Name:    "dest-dir",
			Aliases: []string{"d"},
			Usage:   "Output `directory` for the book\n\tRelative paths are interpreted relative to the book's root directory.",
		},
	},
	Action: CleanAction,
}
View Source
var CompletionsCMD = &cli.Command{
	Name:      "completions",
	Usage:     "Generate shell completions for your shell to stdout",
	ArgsUsage: "<SHELL> \n\n\t <SHELL> the shell to generate completions for [possible values: bash, elvish, fish, powershell, zsh]",

	Flags: []cli.Flag{
		&cli.PathFlag{
			Name:    "dest-dir",
			Aliases: []string{"d"},
			Usage:   "Output `directory` for the book\n\tRelative paths are interpreted relative to the book's root directory.",
		},
		&cli.BoolFlag{
			Name:    "open",
			Aliases: []string{"o"},
			Usage:   "Opens the compiled book in a web browser",
		},
	},
	Action: func(ctx *cli.Context) error {
		fmt.Println("completions")
		return nil
	},
}
View Source
var InitCMD = &cli.Command{
	Name:      "init",
	Usage:     "Creates the boilerplate structure and files for a new book",
	ArgsUsage: "[dir]  \n\n\t [dir] Directory to create the book in (Defaults to the current directory when omitted)",

	Flags: []cli.Flag{
		&cli.BoolFlag{
			Name:  "theme",
			Usage: "Copies the default theme into your source folder",
		},
		&cli.BoolFlag{
			Name:  "force",
			Usage: "Skips confirmation prompts",
		},
		&cli.StringFlag{
			Name:  "title",
			Usage: "Set the book `TITLE`",
		},
		&cli.StringFlag{
			Name:  "ignore",
			Usage: "Creates a VCS `IGNORE` file (i.e. .gitignore) [possible values: none, git]",
		},
	},
	Action: InitAction,
}
View Source
var ServeCMD = &cli.Command{
	Name:      "serve",
	Usage:     "Serves a book at http://localhost:3000, and rebuilds it on changes",
	ArgsUsage: "[dir]  \n\n\t [dir] Root directory for the book (Defaults to the current directory when omitted)",

	Flags: []cli.Flag{
		&cli.PathFlag{
			Name:    "dest-dir",
			Aliases: []string{"d"},
			Usage:   "Output `directory` for the book\n\tRelative paths are interpreted relative to the book's root directory.",
		},
		&cli.StringFlag{
			Name:    "hostname",
			Aliases: []string{"n"},
			Value:   "localhost",
			Usage:   "`HOSTNAME` to listen on for HTTP connections ",
		},
		&cli.Int64Flag{
			Name:    "port",
			Aliases: []string{"p"},
			Value:   3000,
			Usage:   "`PORT` to use for HTTP connections [default: 3000]",
		},
		&cli.BoolFlag{
			Name:    "open",
			Aliases: []string{"o"},
			Usage:   "Opens the compiled book in a web browser",
		},
	},
	Action: func(ctx *cli.Context) error {
		fmt.Println("serve")
		return nil
	},
}
View Source
var TestCMD = &cli.Command{
	Name:      "test",
	Usage:     "Tests that a book's code samples compile",
	ArgsUsage: "[dir]  \n\n\t [dir] Root directory for the book (Defaults to the current directory when omitted)",

	Flags: []cli.Flag{
		&cli.PathFlag{
			Name:    "dest-dir",
			Aliases: []string{"d"},
			Usage:   "Output `directory` for the book\n\tRelative paths are interpreted relative to the book's root directory.",
		},
		&cli.StringFlag{
			Name:    "chapter",
			Aliases: []string{"c"},
			Usage:   "",
		},
		&cli.StringFlag{
			Name:    "library-path",
			Aliases: []string{"L"},
			Usage:   "A comma-separated list of `directories` to add to the crate search path when building tests",
		},
	},
	Action: func(ctx *cli.Context) error {
		fmt.Println("test")
		return nil
	},
}
View Source
var WatchCMD = &cli.Command{
	Name:      "watch",
	Usage:     "Watches a book's files and rebuilds it on changes",
	ArgsUsage: "[dir]  \n\n\t [dir] Root directory for the book (Defaults to the current directory when omitted)",

	Flags: []cli.Flag{
		&cli.PathFlag{
			Name:    "dest-dir",
			Aliases: []string{"d"},
			Usage:   "Output `directory` for the book\n\tRelative paths are interpreted relative to the book's root directory.",
		},
		&cli.BoolFlag{
			Name:    "open",
			Aliases: []string{"o"},
			Usage:   "Opens the compiled book in a web browser",
		},
	},
	Action: WatchAction,
}

Functions

func CleanAction

func CleanAction(ctx *cli.Context) error

func InitAction

func InitAction(ctx *cli.Context) error

func WatchAction

func WatchAction(ctx *cli.Context) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳