add cli commands for sending/viewing termails
This commit is contained in:
parent
91c39549bd
commit
7b63560f74
@ -54,11 +54,52 @@ var logoutCmd = &cobra.Command{
|
|||||||
Run: runLogout,
|
Run: runLogout,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var inboxCmd = &cobra.Command{
|
||||||
|
Use: "inbox",
|
||||||
|
Short: "View your termail inbox",
|
||||||
|
Long: "View, search, and manage your termail inbox.",
|
||||||
|
Run: runInbox,
|
||||||
|
}
|
||||||
|
|
||||||
|
var inboxReadCmd = &cobra.Command{
|
||||||
|
Use: "read [termail_id]",
|
||||||
|
Short: "Mark termail as read",
|
||||||
|
Long: "Mark a specific termail as read by ID.",
|
||||||
|
Args: cobra.ExactArgs(1),
|
||||||
|
Run: runInboxRead,
|
||||||
|
}
|
||||||
|
|
||||||
|
var inboxDeleteCmd = &cobra.Command{
|
||||||
|
Use: "delete [termail_id]",
|
||||||
|
Short: "Delete termail",
|
||||||
|
Long: "Delete a specific termail by ID.",
|
||||||
|
Args: cobra.ExactArgs(1),
|
||||||
|
Run: runInboxDelete,
|
||||||
|
}
|
||||||
|
|
||||||
|
var sendCmd = &cobra.Command{
|
||||||
|
Use: "send [username]",
|
||||||
|
Short: "Send termail to a user",
|
||||||
|
Long: "Send termail to a specific user by username.",
|
||||||
|
Args: cobra.ExactArgs(1),
|
||||||
|
Run: runSend,
|
||||||
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
inboxCmd.Flags().StringP("search", "s", "", "Search termails by content, subject, or sender")
|
||||||
|
inboxCmd.Flags().IntP("limit", "l", 10, "Number of termails to show")
|
||||||
|
inboxCmd.Flags().IntP("offset", "o", 0, "Number of termails to skip")
|
||||||
|
inboxCmd.Flags().Bool("unread", false, "Show only unread termails")
|
||||||
|
|
||||||
|
inboxCmd.AddCommand(inboxReadCmd)
|
||||||
|
inboxCmd.AddCommand(inboxDeleteCmd)
|
||||||
|
|
||||||
authCmd.AddCommand(registerCmd)
|
authCmd.AddCommand(registerCmd)
|
||||||
authCmd.AddCommand(loginCmd)
|
authCmd.AddCommand(loginCmd)
|
||||||
authCmd.AddCommand(logoutCmd)
|
authCmd.AddCommand(logoutCmd)
|
||||||
rootCmd.AddCommand(authCmd)
|
rootCmd.AddCommand(authCmd)
|
||||||
|
rootCmd.AddCommand(inboxCmd)
|
||||||
|
rootCmd.AddCommand(sendCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Execute() error {
|
func Execute() error {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user