Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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
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.