<commit_before>// Copyright 2017 <NAME> <<EMAIL>>. All rights reserved.
// Use of this source code is governed by the AGPLv3 license that can be found in
// the LICENSE file.

package main

import (
	"os"
	"strings"

	"github.com/praelatus/praelatus/commands"
	"github.com/urfave/cli"
)

var version = "master"
var commit = ""
var date = ""

func main() {
	app := cli.NewApp()
	app.Name = "praelatus"
	app.Usage = "Praelatus, an open source bug tracker / ticketing system"

	if !strings.HasPrefix(version, "SNAPSHOT") {
		app.Version = version
	} else {
		app.Version = "DEV-" + commit
	}

	app.Action = commands.RunServer
	app.Flags = []cli.Flag{
		cli.BoolFlag{
			Name:  "devmode",
			Usage: "runs server in devmode which changes some security behavior to ease development",
		},
		cli.BoolFlag{
			Name:  "profile",
			Usage: "runs server profiling for debugging hotspots in the code",
		},
	}

	app.Authors = []cli.Author{
		{
			Name:  "<NAME>",
			Email: "<EMAIL>",
		},
		{
			Name:  "<NAME>",
			Email: "<EMAIL>",
		},
		{
			Name:  "<NAME>",
			Email: "<EMAIL>",
		},
	}

	app.Commands = []cli.Command{
		{
			Name:   "seeddb",
			Usage:  "seed the database with test data",
			Action: commands.SeedDB,
		},
		{
			Name:   "serve",
			Usage:  "start running the REST api",
			Action: commands.RunServer,
		},
		{
			Name:  "config",
			Usage: "various commands for interacting with praelatus config",
			Subcommands: []cli.Command{
				{
					Name:   "show",
					Usage:  "view the configuration for this instance, useful for debugging",
					Action: commands.ShowConfig,
				},
				{
					Name:   "gen",
					Usage:  "generate a config.json based on the current environment variables or defaults",
					Action: commands.GenConfig,
				},
			},
		},
		{
			Name:   "testdb",
			Usage:  "will test the connections to the databases",
			Action: commands.TestDB,
		},
		{
			Name:   "cleandb",
			Usage:  "will clean the database (remove all data), useful for testing",
			Action: commands.CleanDB,
			Flags: []cli.Flag{
				cli.BoolFlag{
					Name:  "yes",
					Usage: "skip the warning prompt",
				},
			},
		},
		{
			Name:   "setupdb",
			Usage:  "Sets up indexes and other administrative tasks for the database",
			Action: commands.SetupDB,
		},
		{
			Name:  "admin",
			Usage: "various admin functions for the instance",
			Subcommands: []cli.Command{
				{
					Name:   "createUser",
					Usage:  "create a user, useful for creating admin accounts",
					Action: commands.AdminCreateUser,
					Flags: []cli.Flag{
						cli.StringFlag{
							Name: "username",
						},
						cli.StringFlag{
							Name: "password",
						},
						cli.StringFlag{
							Name: "fullName",
						},
						cli.StringFlag{
							Name: "email",
						},
						cli.BoolFlag{
							Name:  "admin",
							Usage: "Indicates whether the user is a system admin",
						},
					},
				},
			},
		},
	}

	app.Run(os.Args)
}<commit_msg>Convert to cobra<commit_after>// Copyright 2017 <NAME> <<EMAIL>>. All rights reserved.
// Use of this source code is governed by the AGPLv3 license that can be found in
// the LICENSE file.

package main

import (
	"github.com/praelatus/praelatus/commands"
)

var version = "master"
var commit = "HEAD"
var date = ""

func main() {
	commands.Version = version
	commands.Commit = commit
	commands.Execute()
}
{'fraction_non_alphanumeric': 0.1347134713471347, 'fraction_numerical': 0.003000300030003, 'mean_word_length': 2.696230598669623, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '619868', 'n_tokens_mistral': 1383, 'n_tokens_neox': 1104, 'n_words': 328}