<commit_before>package cmd

import (
	"fmt"
	"github.com/ansible-semaphore/semaphore/db"
	"github.com/spf13/cobra"
)

var newUserArgs userArgs

func init() {
	userAddCmd.PersistentFlags().StringVar(&newUserArgs.login, "login", "", "New user login")
	userAddCmd.PersistentFlags().StringVar(&newUserArgs.name, "name", "", "New user name")
	userAddCmd.PersistentFlags().StringVar(&newUserArgs.email, "email", "", "New user email")
	userAddCmd.PersistentFlags().StringVar(&newUserArgs.password, "password", "", "New user password")
	userCmd.AddCommand(userAddCmd)
}

var userAddCmd = &cobra.Command{
	Use:   "add",
	Short: "Add new user",
	Run: func(cmd *cobra.Command, args []string) {
		store := createStore()
		defer store.Close()

		if _, err := store.CreateUser(db.UserWithPwd{
			Pwd: <PASSWORD>Args.password,
			User: db.User{
				Name: newUserArgs.name,
				Username: newUserArgs.login,
				Email: newUserArgs.email,
			},
		}); err != nil {
			panic(err)
		}

		fmt.Printf("User %s <%s> added!", newUserArgs.login, newUserArgs.email)
	},
}<commit_msg>fix(cli): mark user args as required<commit_after>package cmd

import (
	"fmt"
	"github.com/ansible-semaphore/semaphore/db"
	"github.com/spf13/cobra"
)

var newUserArgs userArgs

func init() {
	userAddCmd.PersistentFlags().StringVar(&newUserArgs.login, "login", "", "New user login")
	if err := userAddCmd.MarkFlagRequired("login"); err != nil {
		panic(err)
	}
	userAddCmd.PersistentFlags().StringVar(&newUserArgs.name, "name", "", "New user name")
	if err := userAddCmd.MarkFlagRequired("name"); err != nil {
		panic(err)
	}
	userAddCmd.PersistentFlags().StringVar(&newUserArgs.email, "email", "", "New user email")
	if err := userAddCmd.MarkFlagRequired("email"); err != nil {
		panic(err)
	}
	userAddCmd.PersistentFlags().StringVar(&newUserArgs.password, "password", "", "<PASSWORD>")
	if err := userAddCmd.MarkFlagRequired("password"); err != nil {
		panic(err)
	}
	userCmd.AddCommand(userAddCmd)
}

var userAddCmd = &cobra.Command{
	Use:   "add",
	Short: "Add new user",
	Run: func(cmd *cobra.Command, args []string) {
		store := createStore()
		defer store.Close()

		if _, err := store.CreateUser(db.UserWithPwd{
			Pwd: <PASSWORD>,
			User: db.User{
				Name: newUserArgs.name,
				Username: newUserArgs.login,
				Email: newUserArgs.email,
				Admin: true,
			},
		}); err != nil {
			panic(err)
		}

		fmt.Printf("User %s <%s> added!", newUserArgs.login, newUserArgs.email)
	},
}
{'fraction_non_alphanumeric': 0.16762060506950122, 'fraction_numerical': 0.001635322976287817, 'mean_word_length': 4.677494199535963, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '3174731', 'n_tokens_mistral': 947, 'n_tokens_neox': 889, 'n_words': 173}