@@ -14,7 +14,7 @@ import (
14
14
"sort"
15
15
)
16
16
17
- var annotateHelpDoc string = `report annotate [-csv] -limbo <limboFile> <resultFile>
17
+ var annotateHelpDoc string = `report annotate [-csv] <limboFile> <resultFile>
18
18
19
19
Annotates a standard x509-limbo results file with information from the provided <limboFile> test descriptors.
20
20
By default this will write the result back to the process standard output.
@@ -24,13 +24,11 @@ Options:
24
24
`
25
25
26
26
var annotateCommand struct {
27
- limboFilePath string
28
- formatAsCsv bool
27
+ formatAsCsv bool
29
28
}
30
29
31
30
var annotateFlagSet = func () * flag.FlagSet {
32
31
fs := flag .NewFlagSet ("annotate" , flag .ExitOnError )
33
- fs .StringVar (& annotateCommand .limboFilePath , "limbo" , "limbo.json" , "location of the limbo test cases" )
34
32
fs .BoolVar (& annotateCommand .formatAsCsv , "csv" , false , "format output as csv rather then the default" )
35
33
fs .Usage = func () {
36
34
fmt .Fprint (fs .Output (), annotateHelpDoc )
@@ -43,16 +41,17 @@ func runAnnotateCommand(args []string) error {
43
41
if err := annotateFlagSet .Parse (args ); err != nil {
44
42
return err
45
43
}
46
- limbo , err := parseLimboFile ( annotateCommand . limboFilePath )
47
- if err != nil {
48
- return err
44
+
45
+ if len ( annotateFlagSet . Args ()) != 2 {
46
+ return fmt . Errorf ( "expect two positional arguments" )
49
47
}
50
48
51
- if len (annotateFlagSet .Args ()) != 1 {
52
- return fmt .Errorf ("expect one positional argument for the result file name" )
49
+ limbo , err := parseLimboFile (annotateFlagSet .Arg (0 ))
50
+ if err != nil {
51
+ return err
53
52
}
54
53
55
- harnessFilePath := annotateFlagSet .Arg (0 )
54
+ harnessFilePath := annotateFlagSet .Arg (1 )
56
55
harnessBytes , err := os .ReadFile (harnessFilePath )
57
56
if err != nil {
58
57
log .Fatalf ("failed to read harnessFile(%v): %v" , harnessFilePath , err )
0 commit comments