feat(gmail): add --full flag to messages search to disable body truncation#447
Open
GodsBoy wants to merge 1 commit intosteipete:mainfrom
Open
feat(gmail): add --full flag to messages search to disable body truncation#447GodsBoy wants to merge 1 commit intosteipete:mainfrom
GodsBoy wants to merge 1 commit intosteipete:mainfrom
Conversation
…ation The --full flag skips the 200-character body truncation in plain-text output. It implies --include-body, so passing --full alone is enough. The gmail thread get command (gog gmail read) already had this flag; this brings parity to the messages search command.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
gog gmail messages search "query" --include-bodytruncates message bodies to 200 characters in plain-text output. For longer emails this cuts off important content, forcing users to pipe through--jsonand manually extract the body field.The
gmail thread getcommand (gog gmail read) already has a--fullflag that disables its 500-character truncation, but the messages search command has no equivalent.Solution
Add a
--fullflag toGmailMessagesSearchCmdthat:sanitizeMessageBody--include-body(so--fullalone is sufficient)--fullis not passedUsage
Testing
TestSanitizeMessageBody_FullSkipsTruncationtest verifying full bodies are preservedmake test)make build)nilnilissue ingmail_filters_helpers.go(present on main, not introduced by this PR)Changes
internal/cmd/gmail_messages.go: AddFullfield, thread it through tosanitizeMessageBodyinternal/cmd/gmail_messages_test.go: Add full-body test, update existing test signatures