(args []string)
| 166 | } |
| 167 | |
| 168 | func (m *CLIBridgeModule) resolveArgs(args []string) ([]string, error) { |
| 169 | if len(args) == 0 { |
| 170 | return args, nil |
| 171 | } |
| 172 | |
| 173 | resolved := make([]string, len(args)) |
| 174 | |
| 175 | for i, arg := range args { |
| 176 | if strings.HasPrefix(arg, `-`) { |
| 177 | resolved[i] = arg |
| 178 | continue |
| 179 | } |
| 180 | |
| 181 | if !m.isPathAllowed(arg) { |
| 182 | return nil, fmt.Errorf("path %q is not within allowed paths", arg) |
| 183 | } |
| 184 | resolved[i] = arg |
| 185 | } |
| 186 | |
| 187 | return resolved, nil |
| 188 | } |
| 189 | |
| 190 | func (m *CLIBridgeModule) cliCommand(rest string, user *users.UserRecord, room *rooms.Room, flags events.EventFlag) (bool, error) { |
| 191 | if !m.isEnabled() { |
no test coverage detected