<commit_before>package main

import (
	"fmt"
	"log"
	"os"
	"os/signal"

	"github.com/codegangsta/cli"
	"github.com/opsee/gozer/router"
)

const (
	version = "0.0.1"
)

func announce(c *cli.Context) {
	tableID := c.String("table")
	if tableID == "" {
		log.Fatal("Must specify --table")
	}

	rtr, err := router.NewRouter(tableID)
	if err != nil {
		log.Fatal(err.Error())
	}

	subnet := c.String("subnet")
	if subnet == "" {
		log.Fatal("Must specify --subnet")
	}

	err = rtr.Announce(subnet)
	if err != nil {
		log.Fatal(err.Error())
	}

	sig := make(chan os.Signal, 1)
	signal.Notify(sig, os.Interrupt, os.Kill)

	// Block until a signal is received.
	s := <-sig
	fmt.Println("Got signal, shutting down:", s)

	err = rtr.Delete(subnet)
	if err != nil {
		log.Fatal(err)
	}<commit_msg>Delete route before adding route<commit_after>package main

import (
	"log"
	"os"

	"github.com/codegangsta/cli"
	"github.com/opsee/gozer/router"
)

const (
	version = "0.0.1"
)

func announce(c *cli.Context) {
	tableID := c.String("table")
	if tableID == "" {
		log.Fatal("Must specify --table")
	}

	rtr, err := router.NewRouter(tableID)
	if err != nil {
		log.Fatal(err.Error())
	}

	subnet := c.String("subnet")
	if subnet == "" {
		log.Fatal("Must specify --subnet")
	}

	err = rtr.Delete(subnet)
	if err != nil {
		log.Fatal(err)
	}

	err = rtr.Announce(subnet)
	if err != nil {
		log.Fatal(err.Error())
	}
{'fraction_non_alphanumeric': 0.18526466380543632, 'fraction_numerical': 0.005007153075822604, 'mean_word_length': 3.331269349845201, 'pattern_counts': {'":': 0, '<': 4, '<?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': '6246848', 'n_tokens_mistral': 613, 'n_tokens_neox': 574, 'n_words': 118}