<commit_before>package main

import (
	"encoding/binary"
	"encoding/json"
	"flag"
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"strconv"
	"time"

	"github.com/yene/gatt"
	"github.com/yene/gatt/examples/option"
)

type Rules struct {
	BeaconUUID   string `json:"uuid"`
	BeaconMajor  string `json:"major"`
	BeaconMinor  string `json:"minor"`
	WebhookEnter string `json:"enter"`
	WebhookLeave string `json:"leave"`
}

type Beacon struct {
	UUID     string    `json:"uuid"`
	Major    int       `json:"major"`
	Minor    int       `json:"minor"`
	Power    int8      `json:"power"`
	LastSeen time.Time `json:"-"`
}

const didEnter = true
const didLeave = false
const defaultPort = ":8080"

var rules []Rules
var foundBeacons []Beacon
var httpAddr = flag.String("addr", defaultPort, "The Web UI address.")
var noweb = flag.Bool("disable", false, "Turn web UI off.")
var interval = flag.Int("interval", 10, "Advertising interval of the beacons, in seconds.")

func main() {
	flag.Parse()
	foundBeacons = make([]Beacon, 0)
	loadRules()

	d, err := gatt.NewDevice(option.DefaultClientOptions...)
	if err != nil {
		log.Fatalf("Failed to open device, err: %s\n", err)
		return<commit_msg>Added option to print version.<commit_after>package main

import (
	"encoding/binary"
	"encoding/json"
	"flag"
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"os"
	"strconv"
	"time"

	"github.com/yene/gatt"
	"github.com/yene/gatt/examples/option"
)

type Rules struct {
	BeaconUUID   string `json:"uuid"`
	BeaconMajor  string `json:"major"`
	BeaconMinor  string `json:"minor"`
	WebhookEnter string `json:"enter"`
	WebhookLeave string `json:"leave"`
}

type Beacon struct {
	UUID     string    `json:"uuid"`
	Major    int       `json:"major"`
	Minor    int       `json:"minor"`
	Power    int8      `json:"power"`
	LastSeen time.Time `json:"-"`
}

const didEnter = true
const didLeave = false
const defaultPort = ":8080"

var version string

var rules []Rules
var foundBeacons []Beacon
var httpAddr = flag.String("addr", defaultPort, "The Web UI address.")
var noweb = flag.Bool("disable", false, "Turn web UI off.")
var interval = flag.Int("interval", 10, "Advertising interval of the beacons, in seconds.")
var printVersion = flag.Bool("version", false, "Print current version.")

func main() {
	flag.Parse()

	if *printVersion {
		// Compile with `go build -ldflags "-X main.version=0.9.2"`
		fmt.Println("Version:", version)
		os.Exit(0)
	}

	foundBeacons = make([]Beacon, 0)
	loadRules()

	d, err := gatt.NewDevice(option.DefaultClientOptions...)
	if err != nil {
		log.Fatalf("Failed to open device, err: %s\n", err)
		return
{'fraction_non_alphanumeric': 0.15079059005013498, 'fraction_numerical': 0.007713073659853451, 'mean_word_length': 3.9884615384615385, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '1800927', 'n_tokens_mistral': 955, 'n_tokens_neox': 923, 'n_words': 252}