X Tutup
Skip to content

Commit 00bdedb

Browse files
committed
💅 Tweak wording
1 parent d876cf1 commit 00bdedb

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

pkg/cmd/repo/clone/clone.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,18 @@ func NewCmdClone(f *cmdutil.Factory, runF func(*CloneOptions) error) *cobra.Comm
3535
}
3636

3737
cmd := &cobra.Command{
38-
Use: "clone <repository> [<directory>] -- [<gitflags>...]",
38+
DisableFlagsInUseLine: true,
39+
40+
Use: "clone <repository> [<directory>] [-- <gitflags>...]",
3941
Args: cobra.MinimumNArgs(1),
4042
Short: "Clone a repository locally",
41-
Long: heredoc.Doc(
42-
`Clone a GitHub repository locally.
43+
Long: heredoc.Doc(`
44+
Clone a GitHub repository locally.
4345
4446
If the "OWNER/" portion of the "OWNER/REPO" repository argument is omitted, it
4547
defaults to the name of the authenticating user.
4648
47-
To pass 'git clone' flags, separate them with '--'.
49+
Pass additional 'git clone' flags by listing them after '--'.
4850
`),
4951
RunE: func(cmd *cobra.Command, args []string) error {
5052
opts.Repository = args[0]
@@ -62,7 +64,7 @@ func NewCmdClone(f *cmdutil.Factory, runF func(*CloneOptions) error) *cobra.Comm
6264
if err == pflag.ErrHelp {
6365
return err
6466
}
65-
return &cmdutil.FlagError{Err: fmt.Errorf("%v\nSeparate git clone flags with `--`.", err)}
67+
return &cmdutil.FlagError{Err: fmt.Errorf("%w\nSeparate git clone flags with '--'.", err)}
6668
})
6769

6870
return cmd

pkg/cmd/repo/clone/clone_test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,8 @@ func Test_RepoClone_withoutUsername(t *testing.T) {
181181
}
182182

183183
func Test_RepoClone_flagError(t *testing.T) {
184-
reg := &httpmock.Registry{}
185-
httpClient := &http.Client{Transport: reg}
186-
187-
_, err := runCloneCommand(httpClient, "--depth 1 OWNER/REPO")
188-
if err == nil || err.Error() != "unknown flag: --depth\nSeparate git clone flags with `--`." {
184+
_, err := runCloneCommand(nil, "--depth 1 OWNER/REPO")
185+
if err == nil || err.Error() != "unknown flag: --depth\nSeparate git clone flags with '--'." {
189186
t.Errorf("unexpected error %v", err)
190187
}
191188
}

0 commit comments

Comments
 (0)
X Tutup