Skip to content

Commit 9859fd4

Browse files
authored
feat: add comment-syntax flag (#139)
1 parent 17d46ab commit 9859fd4

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

cmd/snapshot.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ import (
1313
)
1414

1515
type snapshotFlags struct {
16-
from string
17-
output string
18-
strict bool
16+
from string
17+
output string
18+
strict bool
19+
commentSyntax string
1920
}
2021

2122
func snapshotCommand() cli.Command {
@@ -41,6 +42,12 @@ and symbol information.`,
4142
Destination: &snapshotFlags.strict,
4243
Value: true,
4344
},
45+
&cli.StringFlag{
46+
Name: "comment-syntax",
47+
Usage: "Comment syntax to use for snapshot files",
48+
Destination: &snapshotFlags.commentSyntax,
49+
Value: "//",
50+
},
4451
},
4552
Action: func(c *cli.Context) error {
4653
return snapshotMain(snapshotFlags)
@@ -67,7 +74,7 @@ func snapshotMain(flags snapshotFlags) error {
6774
return errors.Wrap(err, "use --strict=false to ignore this error")
6875
}
6976
}
70-
snapshots, err := testutil.FormatSnapshots(index, "//", symbolFormatter)
77+
snapshots, err := testutil.FormatSnapshots(index, flags.commentSyntax, symbolFormatter)
7178
if err != nil {
7279
return err
7380
}

0 commit comments

Comments
 (0)