util

package
v33.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2019 License: MIT Imports: 3 Imported by: 10

Documentation

Overview

Package util contains shared functions used by several packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CLIDescription

func CLIDescription(s string) (r string)

func StringSliceContains

func StringSliceContains(slice []string, find string) bool

StringSliceContains finds if a string exist in a slice of strings.

func WrapToMargin

func WrapToMargin(s string, width int) (r string)

Types

type CLIStringSlice

type CLIStringSlice []string

CLIStringSlice is used to accept multiple values from a CLI argument like:

-foo value1 -foo value2

Usage:

var foos CLIStringSlice
flag.Var(&foos, "foo", "Some description for this param.")

func (*CLIStringSlice) Set

func (i *CLIStringSlice) Set(value string) error

func (*CLIStringSlice) String

func (i *CLIStringSlice) String() string

type FilterFlags

type FilterFlags struct {
	// Specific exclusions.
	NoEvents     bool
	NoResidences bool
	NoPlaces     bool
	NoSources    bool
	NoMaps       bool
	NoChanges    bool
	NoObjects    bool
	NoLabels     bool
	NoCensuses   bool

	// Only official tags.
	OnlyOfficial bool

	// When comparing, hide lines that are equal on both sides.
	HideEqual bool

	// Condense NAME nodes to a simple string.
	NameFormat string
}

func (*FilterFlags) Filter

func (ff *FilterFlags) Filter(node gedcom.Node) gedcom.Node

func (*FilterFlags) FilterFunctions

func (ff *FilterFlags) FilterFunctions() []gedcom.FilterFunction

func (*FilterFlags) SetupCLI

func (ff *FilterFlags) SetupCLI()

Jump to

Keyboard shortcuts

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