mirror of
https://github.com/MichaelMure/git-bug.git
synced 2025-01-06 01:44:27 +03:00
commands: only return the error (not the function help) when no identity is set
... to avoid misleading a user into thinking the usage was incorrect
This commit is contained in:
parent
ffc6cbdc45
commit
bdf8523dc0
@ -88,7 +88,9 @@ func loadRepoEnsureUser(cmd *cobra.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !set {
|
if !set {
|
||||||
return identity.ErrNoIdentitySet
|
// Print the error directly to not confuse a user
|
||||||
|
_, _ = fmt.Fprintln(os.Stderr, identity.ErrNoIdentitySet.Error())
|
||||||
|
os.Exit(-1)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
@ -25,7 +25,7 @@ const idLength = 40
|
|||||||
const humanIdLength = 7
|
const humanIdLength = 7
|
||||||
|
|
||||||
var ErrNonFastForwardMerge = errors.New("non fast-forward identity merge")
|
var ErrNonFastForwardMerge = errors.New("non fast-forward identity merge")
|
||||||
var ErrNoIdentitySet = errors.New("user identity first needs to be created using \"git bug user create\" or \"git bug user adopt\"")
|
var ErrNoIdentitySet = errors.New("to interact with bugs, an identity first needs to be created using \"git bug user create\" or \"git bug user adopt\"")
|
||||||
var ErrMultipleIdentitiesSet = errors.New("multiple user identities set")
|
var ErrMultipleIdentitiesSet = errors.New("multiple user identities set")
|
||||||
|
|
||||||
var _ Interface = &Identity{}
|
var _ Interface = &Identity{}
|
||||||
|
Loading…
Reference in New Issue
Block a user