def add_first_last_skip(parser, what=None):
    """
    Add first, last, skip arguments to ArgumentParser object.

    Compatible with fractional_slice(). Convenience function for
    analysis scripts.
    """
    if what is None:
        what = ['first', 'last', 'skip']
    if 'first' in what:
        parser.add_argument('-f', '--first', dest='first', type=float,
            default=None, help='first cfg (accepts fractions)')
    if 'last' in what:
        parser.add_argument('-l', '--last', dest='last', type=float,
            default=None, help='last cfg (accepts fractions)')
    if 'skip' in what:
        parser.add_argument('-s', '--skip', dest='skip', type=int, default=
            1, help='interval between cfg')
    return parser
