Commit e75857a 1 parent 2317931 commit e75857a Copy full SHA for e75857a
File tree 4 files changed +31
-9
lines changed
4 files changed +31
-9
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,8 @@ Also this tool can support output results **as a CSV file.**
50
50
- The region to output is selected interactively and does not need to be specified.
51
51
- -o, --output: optional
52
52
- Output file path for CSV format
53
+ - -k, --keyword: optional
54
+ - Keyword for function name filtering (case-insensitive)
53
55
54
56
## Input flow
55
57
@@ -59,6 +61,12 @@ Also this tool can support output results **as a CSV file.**
59
61
❯ lamver
60
62
```
61
63
64
+ You can specify ` -k, --keyword ` option. This is a keyword for ** function name filtering (case-insensitive)** .
65
+
66
+ ``` sh
67
+ ❯ lamver -k goto
68
+ ```
69
+
62
70
### Choose regions
63
71
64
72
``` sh
@@ -126,7 +134,9 @@ Also this tool can support output results **as a CSV file.**
126
134
127
135
You can search function names in a ** case-insensitive** .
128
136
129
- It can be ** empty.**
137
+ ** Empty** input will output ** all functions** .
138
+
139
+ This phase is skipped if you specify ` -k ` option.
130
140
131
141
``` sh
132
142
Filter a keyword of function names(case-insensitive): test-goto
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ require (
13
13
github.com/olekukonko/tablewriter v0.0.5
14
14
github.com/rs/zerolog v1.29.0
15
15
github.com/urfave/cli/v2 v2.25.0
16
+ go.uber.org/goleak v1.2.1
16
17
golang.org/x/sync v0.3.0
17
18
)
18
19
@@ -36,7 +37,6 @@ require (
36
37
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
37
38
github.com/russross/blackfriday/v2 v2.1.0 // indirect
38
39
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
39
- go.uber.org/goleak v1.2.1 // indirect
40
40
golang.org/x/sys v0.1.0 // indirect
41
41
golang.org/x/term v0.0.0-20210503060354-a79de5458b56 // indirect
42
42
golang.org/x/text v0.3.7 // indirect
Original file line number Diff line number Diff line change @@ -78,8 +78,8 @@ github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6us
78
78
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk =
79
79
github.com/russross/blackfriday/v2 v2.1.0 /go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM =
80
80
github.com/stretchr/objx v0.1.0 /go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME =
81
- github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0 =
82
81
github.com/stretchr/testify v1.6.1 /go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg =
82
+ github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk =
83
83
github.com/urfave/cli/v2 v2.25.0 h1:ykdZKuQey2zq0yin/l7JOm9Mh+pg72ngYMeB0ABn6q8 =
84
84
github.com/urfave/cli/v2 v2.25.0 /go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc =
85
85
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU =
Original file line number Diff line number Diff line change @@ -18,10 +18,11 @@ import (
18
18
const SDKRetryMaxAttempts = 3
19
19
20
20
type App struct {
21
- Cli * cli.App
22
- Profile string
23
- DefaultRegion string
24
- CSVOutputFilePath string
21
+ Cli * cli.App
22
+ Profile string
23
+ DefaultRegion string
24
+ CSVOutputFilePath string
25
+ FunctionNameKeyword string
25
26
}
26
27
27
28
func NewApp (version string ) * App {
@@ -49,6 +50,12 @@ func NewApp(version string) *App {
49
50
Usage : "Output file path for CSV format" ,
50
51
Destination : & app .CSVOutputFilePath ,
51
52
},
53
+ & cli.StringFlag {
54
+ Name : "keyword" ,
55
+ Aliases : []string {"k" },
56
+ Usage : "Keyword for function name filtering (case-insensitive)" ,
57
+ Destination : & app .FunctionNameKeyword ,
58
+ },
52
59
},
53
60
}
54
61
@@ -107,8 +114,13 @@ func (a *App) getAction() func(c *cli.Context) error {
107
114
return nil
108
115
}
109
116
110
- keywordLabel := "Filter a keyword of function names(case-insensitive): "
111
- keyword := io .InputKeywordForFilter (keywordLabel )
117
+ var keyword string
118
+ if a .FunctionNameKeyword != "" {
119
+ keyword = a .FunctionNameKeyword
120
+ } else {
121
+ keywordLabel := "Filter a keyword of function names(case-insensitive): "
122
+ keyword = io .InputKeywordForFilter (keywordLabel )
123
+ }
112
124
113
125
createFunctionListInput := & action.CreateFunctionListInput {
114
126
Ctx : c .Context ,
You can’t perform that action at this time.
0 commit comments