Created
January 16, 2020 10:07
-
-
Save edvardm/25e54a2b57812c68b5fd1dfcb5e4064b to your computer and use it in GitHub Desktop.
Very simple template for creating simple python CLI tools with argparse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
def parse_args(): | |
parser = argparse.ArgumentParser( | |
description="", formatter_class=argparse.ArgumentDefaultsHelpFormatter | |
) | |
parser.add_argument("-v", "--verbose", action="store_true", help="be more verbose") | |
return parser.parse_args() | |
def main(): | |
args = parse_args() | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment