| Conditions | 3 |
| Total Lines | 24 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | package cmd |
||
| 12 | func NewResultViewCommand(out io.Writer) (*cobra.Command, error) { |
||
|
|
|||
| 13 | cmd := &cobra.Command{ |
||
| 14 | Use: "result.view", |
||
| 15 | Short: "Read a scan output file and render the folder tree", |
||
| 16 | RunE: buildResultViewCmd(out), |
||
| 17 | } |
||
| 18 | |||
| 19 | cmd.Flags().StringP( |
||
| 20 | flagResultFile, |
||
| 21 | flagResultFileShort, |
||
| 22 | "", |
||
| 23 | "result file to read", |
||
| 24 | ) |
||
| 25 | err := cmd.MarkFlagFilename(flagResultFile) |
||
| 26 | if err != nil { |
||
| 27 | return nil, err |
||
| 28 | } |
||
| 29 | |||
| 30 | err = cmd.MarkFlagRequired(flagResultFile) |
||
| 31 | if err != nil { |
||
| 32 | return nil, err |
||
| 33 | } |
||
| 34 | |||
| 35 | return cmd, nil |
||
| 36 | } |
||
| 52 |