hide potentially long query strings when printing urls
This commit is contained in:
parent
beeb35e7e2
commit
31001877bd
2 changed files with 10 additions and 4 deletions
|
|
@ -353,7 +353,11 @@ func issueCreate(cmd *cobra.Command, args []string) error {
|
|||
url.QueryEscape(body),
|
||||
)
|
||||
// TODO could exceed max url length for explorer
|
||||
fmt.Fprintf(cmd.ErrOrStderr(), "Opening %s in your browser.\n", openURL)
|
||||
url, err := url.Parse(openURL)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Fprintf(cmd.ErrOrStderr(), "Opening %s%s in your browser.\n", url.Host, url.Path)
|
||||
return utils.OpenInBrowser(openURL)
|
||||
} else if action == SubmitAction {
|
||||
params := map[string]interface{}{
|
||||
|
|
|
|||
|
|
@ -148,11 +148,13 @@ func prCreate(cmd *cobra.Command, _ []string) error {
|
|||
url.QueryEscape(title),
|
||||
url.QueryEscape(body),
|
||||
)
|
||||
// TODO maybe do something about -d being discarded when previewing
|
||||
// TODO could exceed max url length for explorer
|
||||
fmt.Fprintf(cmd.ErrOrStderr(), "Opening %s in your browser.\n", openURL)
|
||||
url, err := url.Parse(openURL)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Fprintf(cmd.ErrOrStderr(), "Opening %s%s in your browser.\n", url.Host, url.Path)
|
||||
return utils.OpenInBrowser(openURL)
|
||||
|
||||
} else {
|
||||
panic("Unreachable state")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue