How did Julius Caesar become dictator for life?

He held an election to allow the people to vote for a ruler.
He gave himself the title after the Senate appointed him as ruler.
He let the military generals choose the ruler based on experience in battle.
He was named ruler by the Senate after he threatened a military invasion.