Splash some olive oil into a heavy-based frypan and add the chilli, onion, and capsicum. Cook over medium-high heat until the onion and capsicum are tender, then add the garlic and cook another minute, stirring often
Pour in the tinned tomatoes and a pinch of salt and stir to combine. Bring to a boil, then reduce heat and simmer for 30 minutes.
When the sauce is almost ready, cook the spaghetti in a pot of boiling salted water until al dente. Drain, reserving ΒΌ cup cooking water. Add the spaghetti to the pan with the olives, capers, parsley, and a grinding of black pepper and toss to combine. Add a little cooking water if the mixture seems dry and toss again.
Serve with grated Parmesan and chilli flakes if desired.