Skip to content

Commit 68f71d8

Browse files
committed
Remove webmode
1 parent b366802 commit 68f71d8

File tree

2 files changed

+1
-34
lines changed

2 files changed

+1
-34
lines changed

pkg/cmd/issue/edit/edit.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ type EditOptions struct {
3030

3131
SelectorArg string
3232
Interactive bool
33-
WebMode bool
3433

3534
prShared.EditableOptions
3635
}
@@ -89,7 +88,7 @@ func NewCmdEdit(f *cmdutil.Factory, runF func(*EditOptions) error) *cobra.Comman
8988
}
9089

9190
if opts.Interactive && !opts.IO.CanPrompt() {
92-
return &cmdutil.FlagError{Err: errors.New("--tile, --body, --assignee, --label, --project, --milestone, or --web required when not running interactively")}
91+
return &cmdutil.FlagError{Err: errors.New("--tile, --body, --assignee, --label, --project, or --milestone required when not running interactively")}
9392
}
9493

9594
if runF != nil {
@@ -100,7 +99,6 @@ func NewCmdEdit(f *cmdutil.Factory, runF func(*EditOptions) error) *cobra.Comman
10099
},
101100
}
102101

103-
cmd.Flags().BoolVarP(&opts.WebMode, "web", "w", false, "Open the browser to create an issue")
104102
cmd.Flags().StringVarP(&opts.EditableOptions.Title, "title", "t", "", "Supply a title. Will prompt for one otherwise.")
105103
cmd.Flags().StringVarP(&opts.EditableOptions.Body, "body", "b", "", "Supply a body. Will prompt for one otherwise.")
106104
cmd.Flags().StringSliceVarP(&opts.EditableOptions.Assignees, "assignee", "a", nil, "Assign people by their `login`. Use \"@me\" to self-assign.")
@@ -123,14 +121,6 @@ func editRun(opts *EditOptions) error {
123121
return err
124122
}
125123

126-
if opts.WebMode {
127-
openURL := issue.URL
128-
if opts.IO.IsStdoutTTY() {
129-
fmt.Fprintf(opts.IO.ErrOut, "Opening %s in your browser.\n", utils.DisplayURL(openURL))
130-
}
131-
return opts.OpenInBrowser(openURL)
132-
}
133-
134124
editOptions := opts.EditableOptions
135125
editOptions.TitleDefault = issue.Title
136126
editOptions.BodyDefault = issue.Body

pkg/cmd/issue/edit/edit_test.go

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,6 @@ func TestNewCmdEdit(t *testing.T) {
3636
},
3737
wantsErr: false,
3838
},
39-
{
40-
name: "web flag",
41-
input: "23 --web",
42-
output: EditOptions{
43-
SelectorArg: "23",
44-
Interactive: true,
45-
WebMode: true,
46-
},
47-
wantsErr: false,
48-
},
4939
{
5040
name: "title flag",
5141
input: "23 --title test",
@@ -153,7 +143,6 @@ func TestNewCmdEdit(t *testing.T) {
153143

154144
assert.NoError(t, err)
155145
assert.Equal(t, tt.output.SelectorArg, gotOpts.SelectorArg)
156-
assert.Equal(t, tt.output.WebMode, gotOpts.WebMode)
157146
assert.Equal(t, tt.output.Interactive, gotOpts.Interactive)
158147
assert.Equal(t, tt.output.EditableOptions, gotOpts.EditableOptions)
159148
})
@@ -168,18 +157,6 @@ func Test_editRun(t *testing.T) {
168157
stdout string
169158
stderr string
170159
}{
171-
{
172-
name: "web mode",
173-
input: &EditOptions{
174-
SelectorArg: "123",
175-
WebMode: true,
176-
OpenInBrowser: func(string) error { return nil },
177-
},
178-
httpStubs: func(t *testing.T, reg *httpmock.Registry) {
179-
mockIssueGet(t, reg)
180-
},
181-
stderr: "Opening github.com/OWNER/REPO/issue/123 in your browser.\n",
182-
},
183160
{
184161
name: "non-interactive",
185162
input: &EditOptions{

0 commit comments

Comments
 (0)