NewCoverageCommand - creates a new coverage command
()
| 17 | |
| 18 | // NewCoverageCommand - creates a new coverage command |
| 19 | func NewCoverageCommand() *cobra.Command { |
| 20 | command := &cobra.Command{ |
| 21 | Use: "coverage <file>", |
| 22 | Short: "coverage analysis of authorization model and assertions", |
| 23 | RunE: coverage(), |
| 24 | Args: cobra.ExactArgs(1), |
| 25 | } |
| 26 | |
| 27 | f := command.Flags() |
| 28 | f.Int("coverage-relationships", 0, "the min coverage for relationships") |
| 29 | f.Int("coverage-attributes", 0, "the min coverage for attributes") |
| 30 | f.Int("coverage-assertions", 0, "the min coverage for assertions") |
| 31 | |
| 32 | // register flags for coverage |
| 33 | command.PreRun = func(cmd *cobra.Command, args []string) { |
| 34 | flags.RegisterCoverageFlags(f) |
| 35 | } |
| 36 | |
| 37 | return command |
| 38 | } |
| 39 | |
| 40 | // coverage - coverage analysis of authorization model and assertions |
| 41 | func coverage() func(cmd *cobra.Command, args []string) error { |
no test coverage detected