How to use the pybase64.get_license_text function in pybase64

To help you get started, we’ve selected a few pybase64 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mayeut / pybase64 / pybase64 / __main__.py View on Github external
def main(args=None):
    # main parser
    parser = argparse.ArgumentParser(
        prog=__package__,
        description=__package__ + ' command-line tool.')
    parser.add_argument(
        '-V', '--version',
        action='version',
        version=__package__ + ' ' + pybase64.get_version())
    parser.add_argument(
        '--license',
        action=LicenseAction,
        license=pybase64.get_license_text())
    # create sub-parsers
    subparsers = parser.add_subparsers(help='tool help')
    # benchmark parser
    benchmark_parser = subparsers.add_parser('benchmark', help='-h for usage')
    benchmark_parser.add_argument(
        '-d', '--duration',
        metavar='D',
        dest='duration',
        type=float,
        default=1.0,
        help='expected duration for a single encode or decode test')
    benchmark_parser.add_argument(
        'input',
        type=argparse.FileType('rb'),
        help='input file used for the benchmark')
    benchmark_parser.set_defaults(func=benchmark)