Added getopt support