didn't handle it right

I had to pick T up early from school because he had a sinus headache.  I don't know how this transpired but next thing I know he's complaining and yelling at me.  He did the same thing yesterday because he was hungry.  It's all about food.  He complains that we don't have enough chips in the house or other quick easy to eat food.  We most certainly do most times but I didn't buy any last week because trying to do better.  Soup, cold cuts, and salad, pizza, tuna, macs and cheese didn't do anything for him.  He was so mad and stormed out.  I know I could have handled it differently by not pointing out to him that all he does is complain and take.  Before this argument he offered to vacuum.  I know he wasn't feeling well and I should have not let it get to me.  Now I'm feeling bad.
We have these nice conversations on the way to school but the way home is another story.  Can't win.