#! /usr/bin/env python
#
# Used to record the current state of the working directory without reverting it. This is effectively a shortcut to
# `git stash save` <message> followed by `git stash apply`.
#

import argparse

from commands import snapshot


def main():

    parser = argparse.ArgumentParser(
        prog='git snapshot',
        version='git-snapshot 0.4.0',
        description=snapshot.__doc__,
        epilog='for more detail, use: git help snapshot'
    )

    # <message>
    parser.add_argument(
        'message',
        help='the message to use when creating the underlying stash',
        metavar='<message>',
        default=None,
        nargs='?'
    )

    snapshot.snapshot(**vars(parser.parse_args()))

if __name__ == '__main__':
    main()
