<commit_before>#include "system.h"
#include "sccs.h"

extern char *editor;

int
sendbug_main(int ac,  char **av)
{
	char	buf[MAXLINE];
	char	bug[MAXPATH];
	FILE	*f;

	sprintf(bug, "%s/bk_bug%d", TMP_PATH, getpid());
	f = fopen(bug, "wb");
	gethelp("bugtemplate", 0, f);
	fclose(f);
	sprintf(buf, "%s %s", editor, bug);
	system(buf);
	while (1) {
		printf("(s)end, (e)dit, (q)uit? ");
		unless (fgets(buf, sizeof(buf), stdin)) buf[0] = 'q';
		switch (buf[0]) {
		    case 's':
			mail("<EMAIL>", "BK Bug", bug);<commit_msg>add a --help option for sendbug<commit_after>#include "system.h"
#include "sccs.h"

extern char *editor;

private char *sendbug_help = "\n\
usage: sendbug [ --help]\n\
	This command is used to file a bug report.\n\
	This is a interactive command, it will display a\n\
	bug report template, bring up a editor so the user\n\
	can fill in the bug detail. When the user exit the editor,\n\
	it will ask for confimation to email the bug report\n\
	to the BitKeeper database.\n";

int
sendbug_main(int ac,  char **av)
{
	char	buf[MAXLINE];
	char	bug[MAXPATH];
	FILE	*f;

	if (ac > 1 && streq("--help", av[1]))  {
		fputs(sendbug_help, stderr);
		exit(1);
	}
	sprintf(bug, "%s/bk_bug%d", TMP_PATH, getpid());
	f = fopen(bug, "wb");
	gethelp("bugtemplate", 0, f);
	fclose(f);
	sprintf(buf, "%s %s", editor, bug);
	system(buf);
	while (1) {
		printf("(s)end, (e)dit, (q)uit? ");
		unless (fgets(buf, sizeof(buf), stdin)) buf[0] = 'q';
		switch (buf[0]) {
		    case 's':
			mail("<EMAIL>", "BK Bug", bug);
{'fraction_non_alphanumeric': 0.19499341238471674, 'fraction_numerical': 0.007246376811594203, 'mean_word_length': 4.046511627906977, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '4066181', 'n_tokens_mistral': 655, 'n_tokens_neox': 628, 'n_words': 181}