All Projects → muesli → mango

muesli / mango

Licence: MIT license
mango is a man-page generator for the Go flag, pflag, cobra, coral, and kong packages

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to mango

docker-kong-oidc
Kong + OIDC plugins
Stars: ✭ 83 (-56.54%)
Mutual labels:  kong
django-flag-app
A pluggable django application that adds the ability for users to flag(or report) your models.
Stars: ✭ 13 (-93.19%)
Mutual labels:  flag
gluu-gateway
Gluu API 🚀 and Web Gateway 🎯
Stars: ✭ 29 (-84.82%)
Mutual labels:  kong
etoolbox-authoring-kit
Offers a set of tools that create Granite UI authoring interfaces for Adobe Experience Manager components from Java code. This is a comprehensive solution that makes different widgets work in a coordinated manner, provides greater interactivity in AEM dialogs, and introduces additional features (customizable data lists, options selection, etc.)
Stars: ✭ 93 (-51.31%)
Mutual labels:  coral
type-flag
⛳️ Typed command-line arguments parser for Node.js
Stars: ✭ 105 (-45.03%)
Mutual labels:  flag
kong-konga-example
Setup Kong + Konga + PostgreSQL using Docker Compose
Stars: ✭ 36 (-81.15%)
Mutual labels:  kong
kong-js-pdk
Kong PDK for Javascript and plugin server
Stars: ✭ 28 (-85.34%)
Mutual labels:  kong
kong-plugin-zipkin
A Kong plugin for propogating zipkin spans and reporting spans to a zipkin server - this plugin has been moved into https://github.com/Kong/kong, please open issues and PRs in that repo
Stars: ✭ 60 (-68.59%)
Mutual labels:  kong
country-flag-emoji-json
Country flag emojis in JSON format.
Stars: ✭ 92 (-51.83%)
Mutual labels:  flag
kong-konga-docker-compose
Docker-compose.yml for kong, konga and postgres using official image.
Stars: ✭ 91 (-52.36%)
Mutual labels:  kong
tensorflow-yolov4
YOLOv4 Implemented in Tensorflow 2.
Stars: ✭ 136 (-28.8%)
Mutual labels:  coral
super-dollop
Encrypt your files or notes by your GPG key and save to MinIO or AWS S3 easily!
Stars: ✭ 58 (-69.63%)
Mutual labels:  cobra
kong-oidc-auth
OpenID Connect authentication with Kong gateway
Stars: ✭ 41 (-78.53%)
Mutual labels:  kong
kong-plugins-canary
The grayscale plug-in based on gateway Kong, called Canary, meets A/B testing and dynamically switches upstream agents
Stars: ✭ 31 (-83.77%)
Mutual labels:  kong
producthunt-cli
CLI application to access product hunt
Stars: ✭ 36 (-81.15%)
Mutual labels:  cobra
Country
Country gives a list of countries with all their flags.
Stars: ✭ 26 (-86.39%)
Mutual labels:  flag
laravel-kong
A fluent api wrapper around Kong's API manger designed for Laravel.
Stars: ✭ 20 (-89.53%)
Mutual labels:  kong
cobra-prompt
Connect cobra and go-prompt
Stars: ✭ 24 (-87.43%)
Mutual labels:  cobra
lua-resty-timer
Extended timers for OpenResty
Stars: ✭ 20 (-89.53%)
Mutual labels:  kong
cobrame
A COBRApy extension for genome-scale models of metabolism and expression (ME-models)
Stars: ✭ 30 (-84.29%)
Mutual labels:  cobra

mango

Latest Release Software License Build Status Go ReportCard Go Doc

mango is a man-page generator for the Go flag, pflag, cobra, coral, and kong packages. It extracts commands, flags, and arguments from your program and enables it to self-document.

Adapters

Currently the following adapters exist:

Usage with flag:

import (
    "flag"
    "fmt"

    "github.com/muesli/mango"
    "github.com/muesli/mango/mflag"
    "github.com/muesli/roff"
)

var (
    one = flag.String("one", "", "first value")
    two = flag.String("two", "", "second value")
)

func main() {
    flag.Parse()

    manPage := mango.NewManPage(1, "mango", "a man-page generator").
        WithLongDescription("mango is a man-page generator for Go.\n"+
            "Features:\n"+
            "* User-friendly\n"+
            "* Plugable").
        WithSection("Copyright", "(C) 2022 Christian Muehlhaeuser.\n"+
            "Released under MIT license.")

    flag.VisitAll(mflag.FlagVisitor(manPage))
    fmt.Println(manPage.Build(roff.NewDocument()))
}

Mango will extract all the flags from your app and generate a man-page similar to this example:

mango

Usage with pflag:

import (
    "fmt"

    "github.com/muesli/mango"
    mpflag "github.com/muesli/mango-pflag"
    "github.com/muesli/roff"
    flag "github.com/spf13/pflag"
)

func main() {
    flag.Parse()

    manPage := mango.NewManPage(1, "mango", "a man-page generator").
        WithLongDescription("mango is a man-page generator for Go.").
        WithSection("Copyright", "(C) 2022 Christian Muehlhaeuser.\n"+
            "Released under MIT license.")

    flag.VisitAll(mpflag.PFlagVisitor(manPage))
    fmt.Println(manPage.Build(roff.NewDocument()))
}

Usage with cobra:

import (
	"fmt"

	mcobra "github.com/muesli/mango-cobra"
	"github.com/muesli/roff"
	"github.com/spf13/cobra"
)

var (
    rootCmd = &cobra.Command{
        Use:   "mango",
        Short: "A man-page generator",
    }
)

func main() {
    manPage, err := mcobra.NewManPage(1, rootCmd)
    if err != nil {
        panic(err)
    }

    manPage = manPage.WithSection("Copyright", "(C) 2022 Christian Muehlhaeuser.\n"+
        "Released under MIT license.")

    fmt.Println(manPage.Build(roff.NewDocument()))
}

Usage with coral:

import (
	"fmt"

	mcoral "github.com/muesli/mango-coral"
	"github.com/muesli/roff"
	"github.com/muesli/coral"
)

var (
    rootCmd = &coral.Command{
        Use:   "mango",
        Short: "A man-page generator",
    }
)

func main() {
    manPage, err := mcoral.NewManPage(1, rootCmd)
    if err != nil {
        panic(err)
    }

    manPage = manPage.WithSection("Copyright", "(C) 2022 Christian Muehlhaeuser.\n"+
        "Released under MIT license.")

    fmt.Println(manPage.Build(roff.NewDocument()))
}

Feedback

Got some feedback or suggestions? Please open an issue or drop me a note!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].