use getopt for parsing arguments