#!/usr/bin/env python3

import sys, subprocess

def main():
    import argparse
    parser = argparse.ArgumentParser()
    parser.add_argument("-p", "--paste", action="store_true", help=
        "paste to stdout instead of copy from stdin")
    args = parser.parse_args()

    xclip = ["xclip", "-selection", "clipboard"]
    if args.paste:
        subprocess.check_call(xclip + ["-out"])
    else:
        subprocess.check_call(xclip)

if __name__ == "__main__":
    main()
