Skip to content

Commit 1dd8168

Browse files
committed
Add --list-languages flag
Signed-off-by: Lewis Marshall <[email protected]>
1 parent 730b5fe commit 1dd8168

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ var (
2929
sortOutput bool
3030
silent bool
3131
relative bool
32+
listLangs bool
3233
)
3334

3435
// Initialize flags.
@@ -40,6 +41,7 @@ func init() {
4041
flag.BoolVar(&sortOutput, "sort", true, "sort tags.")
4142
flag.BoolVar(&silent, "silent", false, "do not produce any output on error.")
4243
flag.BoolVar(&relative, "tag-relative", false, "file paths should be relative to the directory containing the tag file.")
44+
flag.BoolVar(&listLangs, "list-languages", false, "list supported languages.")
4345

4446
flag.Usage = func() {
4547
fmt.Fprintf(os.Stderr, "gotags version %s\n\n", Version)
@@ -133,6 +135,11 @@ func main() {
133135
return
134136
}
135137

138+
if listLangs {
139+
fmt.Println("Go")
140+
return
141+
}
142+
136143
files, err := getFileNames()
137144
if err != nil {
138145
fmt.Fprintf(os.Stderr, "cannot get specified files\n\n")

0 commit comments

Comments
 (0)