package main import ( "context" "fmt" "dehub.dev/src/dehub.git" "dehub.dev/src/dehub.git/cmd/dehub/dcmd" ) func cmdInit(ctx context.Context, cmd *dcmd.Cmd) { flag := cmd.FlagSet() path := flag.String("path", ".", "Path to initialize the project at") bare := flag.Bool("bare", false, "Initialize the git repo as a bare repository") remote := flag.Bool("remote", false, "Configure the git repo to allow it to be used as a remote endpoint") cmd.Run(func() (context.Context, error) { _, err := dehub.InitProject(*path, dehub.InitBareRepo(*bare), dehub.InitRemoteRepo(*remote), ) if err != nil { return nil, fmt.Errorf("initializing repo at %q: %w", *path, err) } return nil, nil }) }