Files
pop/cmd/root.go
Michael Freno f5fa35e5d3 FRE-681: Register mail draft command in root
Add mailDraftCmd() to root command to enable draft operations (save, list, edit, send)
2026-04-26 20:02:35 -04:00

46 lines
866 B
Go

package cmd
import (
"fmt"
"os"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "pop",
Short: "ProtonMail CLI tool",
Long: `pop is a CLI tool for interacting with ProtonMail.
It provides commands for managing emails, contacts, and attachments
with full PGP encryption support.`,
}
func NewRootCmd() *cobra.Command {
rootCmd.AddCommand(loginCmd())
rootCmd.AddCommand(logoutCmd())
rootCmd.AddCommand(sessionCmd())
rootCmd.AddCommand(mailCmd())
rootCmd.AddCommand(mailDraftCmd())
rootCmd.AddCommand(contactCmd())
rootCmd.AddCommand(attachmentCmd())
return rootCmd
}
func init() {
cobra.OnInitialize(initConfig)
}
func initConfig() {
// Initialize config loading
// Config is loaded from ~/.config/pop/
}
func Execute() {
if err := rootCmd.Execute(); err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
}
}