How to use the fcp.arguments.add_default_arguments function in fcp

To help you get started, we’ve selected a few fcp 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 freenet / pyFreenet / fcp / invertkey.py View on Github external
def create_parser():
    '''
    Creates an argparse parser.
    '''
    parser = argparse.ArgumentParser(
        prog='fcpinvertkey',
        description='Convert a freenet SSK/USK private URI into its public equivalent.'
    )
    add_default_arguments(parser)

    parser.add_argument(
        'uri',
        nargs='?',
        help='''
            A freenet SSK/USK private URI
        ''',
    )

    return parser
github freenet / pyFreenet / fcp / genkey.py View on Github external
def create_parser():
    '''
    Creates an argparse parser.
    '''
    parser = argparse.ArgumentParser(
        prog='fcpgenkey',
        description='''
            A simple command-line freenet keypair generation command.

            Generates a simple SSK keypair, and prints
            public key, then private key, each on its own line.
        ''',
    )
    add_default_arguments(parser)

    return parser
github freenet / pyFreenet / fcp / get.py View on Github external
def create_parser():
    '''
    Creates an argparse parser.
    '''
    parser = argparse.ArgumentParser(
        prog='fcpget',
        description='A simple command-line freenet key retrieval command'
    )
    add_default_arguments(parser)

    parser.add_argument(
        'key_uri',
        help='''
            A freenet key URI, such as 'freenet:KSK@gpl.txt'.
            Note that the 'freenet:' part may be omitted if you feel lazy
        ''',
    )

    parser.add_argument(
        'outfile',
        nargs='?',
        type=argparse.FileType('w'),
        default=sys.stdout,
        help='''
        The filename to which to write the key's data.