| skipped 22 lines |
23 | 23 | | } |
24 | 24 | | |
25 | 25 | | func runIPC(_ *cobra.Command, _ []string) error { |
26 | | - | // prepare input |
27 | | - | var inputs []string |
28 | | - | if strings.Contains(options.Input, "\n") { |
29 | | - | inputs = strings.Split(options.Input, "\n") |
30 | | - | } else { |
31 | | - | inputs = append(inputs, options.Input) |
32 | | - | } |
33 | | - | |
34 | 26 | | var err error |
35 | 27 | | ASNMap, err = modules.GetAsnMap() |
36 | 28 | | if err != nil { |
| skipped 5 lines |
42 | 34 | | groupByAsn := map[int][]*modules.ASInfo{} |
43 | 35 | | |
44 | 36 | | // do real stuff here |
45 | | - | for _, job := range inputs { |
| 37 | + | for _, job := range options.Inputs { |
46 | 38 | | ip, err := netaddr.ParseIP(strings.TrimSpace(job)) |
47 | 39 | | if err != nil { |
48 | 40 | | continue |
| skipped 60 lines |
109 | 101 | | contents = append(contents, data) |
110 | 102 | | } |
111 | 103 | | StoreData(contents, options) |
112 | | - | |
113 | | - | if !core.FileExists(options.Output) { |
114 | | - | core.ErrorF("No data found") |
115 | | - | } |
116 | 104 | | return nil |
117 | 105 | | } |
118 | 106 | | |
| skipped 8 lines |