<commit_before>package routing

import (
  "fmt"
  "log"
  "os"
  "diserve.didactia.org/lib/db"
  "diserve.didactia.org/lib/help"
  "diserve.didactia.org/lib/util"
)

// Args is a method for parsing and routing the arguments
func Args(args []string) {
  arg, args := util.Shift(os.Args[1:])
  switch arg {
  case "db":
    dbrouter(args)
  case "help":
    helprouter(args)
  case "run":
    runrouter(args)
  default:
    fmt.Println("No argument given, use \"diserve help\" for a list of commands")
  }
}

// dbrouter will, given a slice of arguments, route to the appropriate db functionality
func dbrouter(args []string) {
  arg, args := util.Shift(args)
  switch arg {
  case "init":
    db.Init(args)
  default:
    fmt.Println("No argument given for command \"diserve db\", use \"diserve help db\" for a list of commands")
  }
}

// helprouter is a wrapper for the help parser
func helprouter(args []string) {
  help.Parse(args)
}

// runrouter will, given a slice of arguments, route to the appropriate run functionality
func runrouter(args []string) {
  log.Fatal("Not implemented")
}<commit_msg>fixed message for wrong top level argument<commit_after>package routing

import (
  "fmt"
  "log"
  "os"
  "diserve.didactia.org/lib/db"
  "diserve.didactia.org/lib/help"
  "diserve.didactia.org/lib/util"
)

// Args is a method for parsing and routing the arguments
func Args(args []string) {
  arg, args := util.Shift(os.Args[1:])
  switch arg {
  case "db":
    dbrouter(args)
  case "help":
    helprouter(args)
  case "run":
    runrouter(args)
  case "":
    fmt.Println("No argument given, use \"diserve help\" for a list of commands")
  default:
    fmt.Printf("No such command: %s, use \"diserve help\" for a list of commands\n", arg)
  }
}

// dbrouter will, given a slice of arguments, route to the appropriate db functionality
func dbrouter(args []string) {
  arg, args := util.Shift(args)
  switch arg {
  case "init":
    db.Init(args)
  default:
    fmt.Println("No argument given for command \"diserve db\", use \"diserve help db\" for a list of commands")
  }
}

// helprouter is a wrapper for the help parser
func helprouter(args []string) {
  help.Parse(args)
}

// runrouter will, given a slice of arguments, route to the appropriate run functionality
func runrouter(args []string) {
  log.Fatal("Not implemented")
}
{'fraction_non_alphanumeric': 0.12692307692307692, 'fraction_numerical': 0.0008547008547008547, 'mean_word_length': 3.554474708171206, 'pattern_counts': {'":': 9, '<': 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': '1027017', 'n_tokens_mistral': 779, 'n_tokens_neox': 786, 'n_words': 258}