Fry the onions in olive oil over low heat until soft, press the garlic into the pan, add chilli (or chilli powder) if you like and fry briefly. Then add the tomatoes along with the juice and mash them with a wooden spoon, bring to a simmer and reduce a little over a low temperature (about half an hour). This step can be skipped or shortened if you are short of time.
Add the salted water for the pasta and cook the pasta until al dente. Meanwhile, heat the drained beans in the sauce, mash a little if you like (this will make the sauce a little more mushy) and add the olives as well. Season to taste with salt and pepper.
Mix the drained pasta with the sauce. Mix in the chopped herbs, season again to taste and serve.
The dish is ready very quickly if the preparation, preserving and noodle cooking times are cleverly coordinated. Spices and proportions can of course be varied as desired. Conceivable would be e.g., a supplement with capers or herbs such as oregano, thyme or marjoram.
Grated parmesan, mozzarella and a fresh salad or antipasti go well with it.