We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4c27855 commit 016bf00Copy full SHA for 016bf00
cmd/errno/run_unix.go
@@ -27,10 +27,11 @@ func run(cmd *cobra.Command, args []string) error {
27
}
28
29
if util.Must2(cmd.Flags().GetBool(FlagSearch)) {
30
- var searchStr string
31
- if len(args) != 0 {
32
- searchStr = strings.ToLower(args[0])
+ if len(args) == 0 {
+ cmd.SilenceUsage = false
+ return cobra.ExactArgs(1)(cmd, args)
33
34
+ searchStr := strings.ToLower(args[0])
35
for e := range errno.Iter() {
36
if strings.Contains(e.Error(), searchStr) {
37
if err := printErrno(cmd, e); err != nil {
@@ -41,6 +42,11 @@ func run(cmd *cobra.Command, args []string) error {
41
42
return nil
43
44
45
46
47
48
+ }
49
+
50
if len(args) == 0 {
51
52
0 commit comments