<commit_before>package main

import (
	"fmt"
	"net/url"
	"strings"
)

func init() {
	h := NewHandler()
	h.CommandName = "status"
	h.CommandPattern = "(status)( )(.*)"
	h.CommandParser = func(cmd *Command) map[string]string {
		argParts := strings.Split(cmd.Args, " ")
		m := make(map[string]string)
		m["scheme"] = "http"
		m["host"] = server.host
		m["port"] = server.port
		m["endpoint"] = "_status"
		if argParts[0] != "/" {
			m["index"] = argParts[0]
		}
		return m
	}
	h.HandlerFunc = func(cmd *Command) string {
		m := h.CommandParser(cmd)
		u := new(url.URL)
		u.Scheme = m["scheme"]
		u.Host = m["host"] + ":" + m["port"]
		index, ok := m["index"]
		if ok {
			index += "/"
		}
		u.Path = index + m["endpoint"]
		q := u.Query()
		q.Add("pretty", "true")
		u.RawQuery = q.Encode()
		fmt.Println("Request:", u)
		res, err := getHttpResource(u.String())
		if err != nil {
			return err.Error()
		}
		return res
	}
	HandlerRegistry[h.CommandName] = h
}<commit_msg>Added usage.<commit_after>package main

import (
	"fmt"
	"net/url"
	"strings"
)

func init() {
	h := NewHandler()
	h.CommandName = "status"
	h.CommandPattern = "(status)( )(.*)"
	h.CommandParser = func(cmd *Command) (map[string]string, bool) {
		argParts := strings.Split(cmd.Args, " ")

		if len(argParts) == 0 {
			return nil, false
		}

		m := make(map[string]string)
		m["scheme"] = "http"
		m["host"] = server.host
		m["port"] = server.port
		m["endpoint"] = "_status"
		if argParts[0] != "/" {
			m["index"] = argParts[0]
		}
		return m, true
	}
	h.HandlerFunc = func(cmd *Command) string {
		m, ok := h.CommandParser(cmd)
		if !ok {
			return "Usage:"
		}
		u := new(url.URL)
		u.Scheme = m["scheme"]
		u.Host = m["host"] + ":" + m["port"]
		index, ok := m["index"]
		if ok {
			index += "/"
		}
		u.Path = index + m["endpoint"]
		q := u.Query()
		q.Add("pretty", "true")
		u.RawQuery = q.Encode()
		fmt.Println("Request:", u)
		res, err := getHttpResource(u.String())
		if err != nil {
			return err.Error()
		}
		return res
	}
	HandlerRegistry[h.CommandName] = h
}
{'fraction_non_alphanumeric': 0.2100881488736533, 'fraction_numerical': 0.002448579823702253, 'mean_word_length': 3.2474012474012475, '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': '1625609', 'n_tokens_mistral': 888, 'n_tokens_neox': 809, 'n_words': 170}