<commit_before>package main

import (
	"fmt"
	"net"
	"regexp"
)

func revers(ip4 string) {
	regE := regexp.MustCompile("[-a-z0-9]*")
	Hostname, err := net.LookupAddr(ip4)
	if err == nil {
		fmt.Printf("%s\n", regE.FindString(Hostname[0]))
	}
}

func main() {

	regS := regexp.MustCompile("[0-9.]*")
	interfaces, _ := net.Interfaces()
	for _, inter := range interfaces {
		if addrs, err := inter.Addrs(); err == nil {
			for _, addr := range addrs {
				monip := regS.FindString(addr.String())
				if monip != "127.0.0.1" {
					revers(monip)
				}
			}
		}
	}

}<commit_msg>Add short, domain, fqdn flags like hostname command.<commit_after>package main

import (
	"flag"
	"fmt"
	"net"
	"regexp"
)

func revers(ip4 string, fqdn bool, short bool, domain bool) {
	Hostname, err := net.LookupAddr(ip4)
	if err == nil {
		switch {
		case domain:
			regE := regexp.MustCompile("^[^.]*[.](.*)[.]$")
			fmt.Printf("%s\n", regE.FindStringSubmatch(Hostname[0])[1])
		case fqdn:
			regE := regexp.MustCompile("^(.*)[.]$")
			fmt.Printf("%s\n", regE.FindStringSubmatch(Hostname[0])[1])
		default:
			regE := regexp.MustCompile("^([^.]*)")
			fmt.Printf("%s\n", regE.FindStringSubmatch(Hostname[0])[1])
		}
	}
}

func main() {

	fqdnPtr := flag.Bool("f", false, "long host name (FQDN)")
	shortPtr := flag.Bool("s", false, "short host name")
	domainPtr := flag.Bool("d", false, "DNS domain name")
	flag.Parse()

	regS := regexp.MustCompile("[0-9.]*")
	interfaces, _ := net.Interfaces()
	for _, inter := range interfaces {
		if addrs, err := inter.Addrs(); err == nil {
			for _, addr := range addrs {
				monip := regS.FindString(addr.String())
				if monip != "127.0.0.1" {
					revers(monip, *fqdnPtr, *shortPtr, *domainPtr)
				}
			}
		}
	}

}
{'fraction_non_alphanumeric': 0.20600115406809003, 'fraction_numerical': 0.01673398730525101, 'mean_word_length': 3.5511811023622046, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5472633', 'n_tokens_mistral': 773, 'n_tokens_neox': 702, 'n_words': 141}