From 0361c25e3973b8d20b12eda4c212100149c12f7b Mon Sep 17 00:00:00 2001 From: iaacornus Date: Sat, 4 Jun 2022 18:42:50 +0800 Subject: [PATCH] initial work for cli --- cli.py | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 cli.py diff --git a/cli.py b/cli.py new file mode 100644 index 0000000..9abba77 --- /dev/null +++ b/cli.py @@ -0,0 +1,53 @@ +import argparse + + +def program_options(): + description = """\ + DESCRIPTION HERE. + """ + + parser = argparse.ArgumentParser( + prog="RedditVideoMakerBot", # can be renamed, just a base + usage="RedditVideoMakerBot [OPTIONS]", + description=description + ) + parser.add_argument( + "-c", + "--create", + help="Create a video.", + action="store_true" + ) + # this one accepts link as input, as well as already downloaded video, + # defaults to the minecraft video. + parser.add_argument( + "-b", + "--background", + help="Use another video background for video (accepts link).", + action="store" + ) + parser.add_argument( # only accepts the name of subreddit, not links. + "-S", + "--subreddit", + help="Use another sub-reddit.", + action="store" + ) + # show most of the background processes of the program + parser.add_argument( + "-v", + "--verbose", + help="Show the processes of program.", + action="store_true" + ) + + args = parser.parse_args() + + try: + ... + except ( + ConnectionError, + KeyboardInterrupt + ): + ... + + +program_options()