urfavecli

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

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

Go to latest
Published: Nov 21, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package urfavecli contains utility functions for working with https://github.com/urfave/cli.

Index

Constants

View Source
const MarkdownDocTemplate = `# NAME

{{ .App.Name }}{{ if .App.Usage }} - {{ .App.Usage }}{{ end }}

# SYNOPSIS

{{ .App.Name }}
{{ if .SynopsisArgs }}
` + "```" + `
{{ range $v := .SynopsisArgs }}{{ $v }}{{ end }}` + "```" + `
{{ end }}{{ if .App.UsageText }}
# DESCRIPTION

{{ .App.UsageText }}
{{ end }}
**Usage**:

` + "```" + `
{{ .App.Name }} [GLOBAL OPTIONS] command [COMMAND OPTIONS] [ARGUMENTS...]
` + "```" + `
{{ if .GlobalArgs }}
# GLOBAL OPTIONS
{{ range $v := .GlobalArgs }}
{{ $v }}{{ end }}
{{ end }}{{ if .Commands }}
# COMMANDS
{{ range $v := .Commands }}
{{ $v }}{{ end }}{{ end }}`

MarkdownDocTemplate is a common template used to format commands as Markdown.

Variables

This section is empty.

Functions

func LogFlags

func LogFlags(cliContext *cli.Context)

LogFlags reflects all the flags and their values as Info logs.

Should be called from within the Action of a Command after logging is setup.

Example

&cli.Command{
    Name:        "my-command",
    Action: func(c *cli.Context) error {
        urfavecli.LogFlags(c)
        // Do command stuff.
    },
},

Types

This section is empty.

Jump to

Keyboard shortcuts

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