-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Closed
1 / 11 of 1 issue completedLabels
enhancementa request to improve CLIa request to improve CLIhelp wantedContributions welcomeContributions welcome
Description
Describe the feature or problem you’d like to solve
I am trying to use the "--template" formatting with gh search issues, and I want to remove newlines from the title of the issues. I tried using {{.title | replace \"\n\" " "}}:
gh search issues --sort updated --include-prs --author @me --json isPullRequest,repository,title,number,labels,updatedAt,state,url,commentsCount --template "{{range .}}{{.isPullRequest}} {{.repository.nameWithOwner}} {{.title | replace \"\n\" \" \"}} {{.number}} {{.state}} {{.updatedAt}} {{.labels}} {{.url}} \n\n {{end}}" --state open
I get an error saying:
the function "replace" is not defined
There is a replace function available in the "sprig library", but it appears that this is not available in gh.
Proposed solution
Add the replace function from sprig library for go template formatting.
Sub-issues
Metadata
Metadata
Assignees
Labels
enhancementa request to improve CLIa request to improve CLIhelp wantedContributions welcomeContributions welcome