def get_histogram_from_args(parser, args):
    """To be used with add_histogram_args.
	
	Check that the supplied arguments are valid and returns the number of bins
	requested.
	
	Returns
	-------
	int
		The number of bins to use in the wire-length histogram.
	"""
    if args.histogram_bins < 1:
        parser.error('--histogram-bins must be at least 1')
    return args.histogram_bins
