Using getopt to parse long options

From: Vikas Agnihotri (
Date: 10/04/03

Date: Sat, 04 Oct 2003 00:10:12 -0400

Red Hat 9.0, getopt (enhanced) 1.1.2

I am trying to use getopt to validate/parse long command line options and
not getting anywhere.

I am doing something like

getopt -l a-long:,b-long: -- "--a-long a --b-long b"

I get

Why do I get -- as the output?
How to use this stuff? I am surprised that are so few examples of this to 
be found.