surveygen

command module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2020 License: MIT Imports: 1 Imported by: 0

README

GitHub Release Go Report Card License

surveygen

generate interactive surveys from yaml files

Generate code for surveys that you can use with github.com/AlecAivazis/survey/v2.

It will save you some time if you need to maintain large surveys and prefer to keep a simple yaml file instead of code.

Check an example yaml to see how to create it and use it in code.

Installation

Binaries

Go to release page and download the binary you need.

Module

go get github.com/guumaster/surveygen

Usage as CLI:
	surveygen is a CLI tool to generate go code for surveys from a yaml definition file.

	Usage:
	  surveygen [flags]

	Flags:
	  -h, --help           help for surveygen
	  -p, --path strings   path to look for survey definitions (default [$CWD])

Usage as module:

cd into your project root folder, then run:

	$> go run github.com/guumaster/surveygen . --path path/to/your/survey

Usage with go generate

Add the following line to your main or any other .go file you prefer:

	//go:generate surveygen --path demo --path path/to/your/survey --path another/path
TODO

Features that I'd like to add:

  • Some more documentation
  • Allow usage as module to generate questions on the fly instead of generating code
  • Validate yaml content, right now it may panic or generate wrong code
References
LICENSE

MIT license

Author(s)

Documentation

Overview

Usage as CLI:

surveygen is a CLI tool to generate go code for surveys from a yaml definition file.

Usage:
  surveygen [flags]

Flags:
  -h, --help           help for surveygen
  -p, --path strings   path to look for survey definitions (default [$CWD])

Usage as module:

cd into your project root folder, then run:

```

$> go run github.com/guumaster/surveygen . --path path/to/your/survey

```

Usage with `go generate`

Add the following line to your main or any other .go file you prefer:

```

//go:generate surveygen --path demo --path path/to/your/survey --path another/path

```

Package main is a CLI to generate code for your surveys.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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