feat(mail): add --all flag to 'gt mail inbox' command
Adds --all/-a flag as a semantic complement to --unread. While the default behavior already shows all messages, --all makes the intent explicit when viewing the complete inbox. The flags are mutually exclusive - using both --all and --unread returns an error. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
beads/crew/emma
parent
cd347dfdf9
commit
d610d444d7
@@ -30,6 +30,11 @@ func getMailbox(address string) (*mail.Mailbox, error) {
|
||||
}
|
||||
|
||||
func runMailInbox(cmd *cobra.Command, args []string) error {
|
||||
// Check for mutually exclusive flags
|
||||
if mailInboxAll && mailInboxUnread {
|
||||
return errors.New("--all and --unread are mutually exclusive")
|
||||
}
|
||||
|
||||
// Determine which inbox to check (priority: --identity flag, positional arg, auto-detect)
|
||||
address := ""
|
||||
if mailInboxIdentity != "" {
|
||||
@@ -46,6 +51,8 @@ func runMailInbox(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
|
||||
// Get messages
|
||||
// --all is the default behavior (shows all messages)
|
||||
// --unread filters to only unread messages
|
||||
var messages []*mail.Message
|
||||
if mailInboxUnread {
|
||||
messages, err = mailbox.ListUnread()
|
||||
|
||||
Reference in New Issue
Block a user