goshellshocked

package
v0.0.0-...-80b9423 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessHistoryFile

func ProcessHistoryFile(filename string) ([]string, error)

ProcessHistoryFile parses and returns the commands of the provided history file.

func Write

func Write(commands Commands) error

Write will write the provided commands. Depends on the value set in the output flag.

Types

type Commands

type Commands struct {
	// contains filtered or unexported fields
}

Commands is a container for a list of commands along with their frequencies..

func ToCommands

func ToCommands(wl []string) Commands

ToCommands converts a slice of terminal commands into a Commands type.

func (Commands) FilterFrequencies

func (s Commands) FilterFrequencies(frequency int) Commands

FilterFrequencies returns the Commands that have a higher or equal frequency count than the one provided.

func (Commands) GetData

func (s Commands) GetData() []string

GetData returns the underlying slice of commands.

func (Commands) GetFrequency

func (s Commands) GetFrequency(command string) int

GetFrequency returns the frequency of the provided command.

func (Commands) Len

func (s Commands) Len() int

func (Commands) Less

func (s Commands) Less(i, j int) bool

func (Commands) Swap

func (s Commands) Swap(i, j int)

Jump to

Keyboard shortcuts

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