def main():
	# Create Options Parser:
	parser = OptionParser (option_class=eng_option, conflict_handler="resolve")
	expert_grp = parser.add_option_group("Expert")

	parser.add_option("-f", "--freq", type="eng_float", default=866.9625e6,
						help="set control channel frequency to MHz [default=%default]", metavar="FREQ")
	parser.add_option("-c", "--centerfreq", type="eng_float", default=867.5e6,
						help="set center receive frequency to MHz [default=%default]. Set to center of 800MHz band for best results")
	parser.add_option("-g", "--gain", type="int", default=None,
						help="set RF gain", metavar="dB")
	parser.add_option("-b", "--bandwidth", type="eng_float", default=3e6,
						help="set bandwidth of DBS RX frond end [default=%default]")
	parser.add_option("-F", "--filename", type="string", default=None,
						help="read data from filename rather than USRP")
	parser.add_option("-t", "--tgfile", type="string", default="sf_talkgroups.csv",
						help="read in CSV-formatted talkgroup list for pretty printing of talkgroup names")
	parser.add_option("-C", "--chanlistfile", type="string", default="motochan14.csv",
						help="read in list of Motorola channel frequencies (improves accuracy of frequency decoding) [default=%default]")
	parser.add_option("-e", "--allowdupes", action="store_false", default=True,
						help="do not eliminate duplicate records (produces lots of noise)")
	parser.add_option("-E", "--error", type="eng_float", default=0,
						help="enter an offset error to compensate for USRP clock inaccuracy")
	parser.add_option("-u", "--audio", action="store_true", default=False,
						help="output audio on speaker")
	parser.add_option("-m", "--monitor", type="int", default=None,
						help="monitor a specific talkgroup")
	parser.add_option("-v", "--volume", type="eng_float", default=0.2,
						help="set volume gain for audio output [default=%default]")
	parser.add_option("-s", "--squelch", type="eng_float", default=28,
						help="set audio squelch level (default=%default, play with it)")
	parser.add_option("-s", "--subdev", type="string",
						help="UHD subdev spec", default=None)
	parser.add_option("-A", "--antenna", type="string", default=None,
					help="select Rx Antenna where appropriate")
	parser.add_option("-r", "--rate", type="eng_float", default=64e6/18,
						help="set sample rate [default=%default]")
	parser.add_option("-a", "--addr", type="string", default="",
						help="address options to pass to UHD")

	#receive_path.add_options(parser, expert_grp)

	(options, args) = parser.parse_args ()

	if len(args) != 0:
		parser.print_help(sys.stderr)
		sys.exit(1)

	if options.tgfile is not None:
		tgreader=csv.DictReader(open(options.tgfile), quotechar='"')
		shorttglist = {"0": 0}
		longtglist = {"0": 0}
		for record in tgreader: