<commit_before>package main


import (
    "fmt"
    "os"
    "path/filepath"
    "github.com/dmulholland/clio/go/clio"
    "github.com/dmulholland/ironclad/irondb"
)


// Help text for the 'new' command.
var newHelp = fmt.Sprintf(`
Usage: %s new [FLAGS] ARGUMENTS

  Create a new password database.

Arguments:
  <file>                    Filename for the new database.

Flags:
  --help                    Print this command's help text and exit.
`, filepath.Base(os.Args[0]))


// Callback for the 'new' command.
func newCallback(parser *clio.ArgParser) {

    // Check that a filename argument has been supplied.
    if !parser.HasArgs() {
        exit("you must supply a filename")
    }
    filename := parser.GetArgs()[0]

    // Prompt for a password if none has been supplied.
    password := parser.GetStr("<PASSWORD>")
    if password == "" {
        password = inputPass("Password: ")
    }

    // Initialize a new database.
    db := irondb.New()

    // Cache the password and filename.
    setCachedPassword(password)
    setCachedFilename(filename)

    // Save the new database to disk.
    saveDB(filename, password, db)
}
<commit_msg>Housekeeping<commit_after>package main


import (
    "fmt"
    "os"
    "path/filepath"
    "github.com/dmulholland/clio/go/clio"
    "github.com/dmulholland/ironclad/irondb"
)


// Help text for the 'new' command.
var newHelp = fmt.Sprintf(`
Usage: %s new [FLAGS] ARGUMENTS

  Create a new password database.

Arguments:
  <file>                    Filename for the new database.

Flags:
  --help                    Print this command's help text and exit.
`, filepath.Base(os.Args[0]))


// Callback for the 'new' command.
func newCallback(parser *clio.ArgParser) {

    // Check that a filename argument has been supplied.
    if !parser.HasArgs() {
        exit("you must supply a filename")
    }
    filename := parser.GetArgs()[0]

    // Prompt for a password if none has been supplied.
    password := parser.GetStr("master<PASSWORD>")
    if password == "" {
        password = inputPass("Master Password: ")
    }

    // Initialize a new database.
    db := irondb.New()

    // Cache the password and filename.
    setCachedPassword(password)
    setCachedFilename(filename)

    // Save the new database to disk.
    saveDB(filename, password, db)
}

{'fraction_non_alphanumeric': 0.11561691113028473, 'fraction_numerical': 0.001725625539257981, 'mean_word_length': 2.524316109422492, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1026783', 'n_tokens_mistral': 737, 'n_tokens_neox': 706, 'n_words': 213}