Documentation
¶
Overview ¶
Package cmd implements the txeh command-line interface.
Index ¶
- Variables
- func AddHosts(ip string, hosts []string, comment string)
- func Execute()
- func ListByCIDRs(cidrs []string)
- func ListByComment(comment string)
- func ListByHostnames(hostnames []string)
- func ListByIPs(ips []string)
- func RemoveByComment(comment string)
- func RemoveHosts(hosts []string)
- func RemoveIPRanges(cidrs []string)
- func ShowHosts()
- func VersionFromBuild() (version string)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // HostsFileReadPath specifies the host file to read. HostsFileReadPath string // HostsFileWritePath specifies the path to write the resulting host file. HostsFileWritePath string // Quiet results in no output. Quiet bool // DryRun sends output to STDOUT (ignores quiet). DryRun bool // Flush triggers a DNS cache flush after writing the hosts file. Flush bool // MaxHostsPerLine limits hostnames per line (0=auto, -1=unlimited, >0=explicit). MaxHostsPerLine int )
View Source
var Version = "0.0.0"
Version is the application version, set by goreleaser.
Functions ¶
func ListByCIDRs ¶
func ListByCIDRs(cidrs []string)
ListByCIDRs lists hostnames for the given CIDR ranges.
func ListByComment ¶ added in v1.7.0
func ListByComment(comment string)
ListByComment lists hostnames with the given comment.
func ListByHostnames ¶
func ListByHostnames(hostnames []string)
ListByHostnames lists IP addresses for the given hostnames.
func RemoveByComment ¶ added in v1.7.0
func RemoveByComment(comment string)
RemoveByComment removes all host entries with the given comment.
func RemoveHosts ¶
func RemoveHosts(hosts []string)
RemoveHosts removes the given hostnames from the hosts file.
func RemoveIPRanges ¶
func RemoveIPRanges(cidrs []string)
RemoveIPRanges removes IP addresses in the given CIDR ranges from the hosts file.
func VersionFromBuild ¶
func VersionFromBuild() (version string)
VersionFromBuild returns the version of txeh binary.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.