Heat the oil in a heavy based pan and stir in the onions to coat them with oil, then sprinkle with the sugar and cook for 5 minutes or until translucent. Add the vinegar and olives, season and simmer for a further 2 minutes.
Remove from he heat and stir in the butter.
Sprinkle with parsley, then check the seasoning and toss with hot pasta.