All Projects → kurehajime → flagstone

kurehajime / flagstone

Licence: MIT License
flagstone is a Go library to convert flags to web UI.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to flagstone

escape-from-the-maze
A simple & tiny CUI maze game
Stars: ✭ 13 (-40.91%)
Mutual labels:  cui
public
util toolkit for go.golang 通用函数包
Stars: ✭ 135 (+513.64%)
Mutual labels:  cui
Wtf
The personal information dashboard for your terminal
Stars: ✭ 12,973 (+58868.18%)
Mutual labels:  cui
Fac
Easy-to-use CUI for fixing git conflicts
Stars: ✭ 1,738 (+7800%)
Mutual labels:  cui
Kubebox
⎈❏ Terminal and Web console for Kubernetes
Stars: ✭ 1,855 (+8331.82%)
Mutual labels:  cui
texdoc
Find and view documentation in TeX Live
Stars: ✭ 31 (+40.91%)
Mutual labels:  cui

flagstone

flagstone is a Go library to convert flags to web UI.

flagstone

install

go get github.com/kurehajime/flagstone

usage

  1. Use golang's standard flag package.

    package main
    
    import (
        "flag"
        "fmt"
    )
    
    var who *string
    
    func main() {
        who = flag.String("who", "world", "say hello to ...")
        flag.Parse()
    
        fmt.Println("hello " + *who + "!")
    }
    
  2. Import flagstone and add one line.

    package main
    
    import (
        "flag"
        "github.com/kurehajime/flagstone" //★ here ★
        "fmt"
    )
    
    var who *string
    
    func main() {
        who = flag.String("who", "world", "say hello to ...")
        flag.Parse()
    
        flagstone.Launch("helloworld", "flagstone sample") //★ here ★
    
        fmt.Println("hello " + *who + "!")
    }
    
    
  3. Finish!

    When you run the program, the browser starts.

    Pressing the "Run" button sets the flag and runs the program.

    screenshot

options

SetPort

Specify the port number.

SetSubURL

Specify sub URL. If not specified, it is determined randomly.

SetSort

Specify the order of the parameters. If not specified, it will be in ABC order.

SetSilent

If set to true, flagstone will not produce any extra output.

SetUseNonFlagArgs

If true is set, non-flag arguments are added. non-flag arguments can be obtained by the return value of the Lanch method.

SetCSS

Specify CSS.

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].