gherkinfmt

command module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2016 License: MIT Imports: 11 Imported by: 0

README

gherkinfmt - Gherkin Formater

gherkinfmt is a command line tool to format .feature files which use the Gherkin language that drives Story/Feature based Behavior Driven Development.

gherkinfmt is written in golang and is just a frontend to the go-gherkin package which covers all the parsing and formating.

Install

Install from source
$ go install github.com/muhqu/gherkinfmt
...
$ gherkinfmt -version # verify install
Install binary

Grap a binary release from the releases section.

Usage

gherkinfmt OPTIONS

Formating Options
  -centersteps[=false]       control step alignment
  -nosteps[=false]           hide steps
  -nocomments[=false]        hide comments
  -noaligncomments[=false]   disable auto alignment of subsequent comments
  -mincommentindent=NUM      use min indent for aligned comments

IO Options
  -[no]color                 explicitly enable/disable colors
  -in PATH                   path to input file, defaults to stdin
  -out PATH                  path to output file, defaults to stdout

Misc Options
  -version                   version: ...
  -help                      this help

Examples

$ gherkinfmt -in path/to/some.feature
$ cat path/to/some.feature | gherkinfmt -centersteps

Thanks

Thanks to @peppe for the util package which is used to detect whether os.Stdout is a Terminal or not.

Thanks to @pointlander for the incredibble peg package, providing a Parser Expression Grammar Parser Generator. go-gherkin is implemented using peg.

Author

© 2014 by Mathias Leppich
github.com/muhqu, @muhqu

Documentation

Overview

Command gherkinfmt is a command-line gherkin formater and pretty printer.

Usage

gherkinfmt OPTIONS

Formating Options
  -centersteps[=false]       control step alignment
  -fixands[=false]           successive step keywords replaced by 'And'
  -nosteps[=false]           hide steps
  -nocomments[=false]        hide comments
  -noaligncomments[=false]   disable auto alignment of subsequent comments
  -mincommentindent=NUM      use min indent for aligned comments

IO Options
  -[no]color                 explicitly enable/disable colors
  -in PATH                   path to input file, defaults to stdin
  -out PATH                  path to output file, defaults to stdout

Misc Options
  -version                   version: ...
  -help                      this help

Examples

$ gherkinfmt -in path/to/some.feature

$ cat path/to/some.feature | gherkinfmt -centersteps

Jump to

Keyboard shortcuts

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