Ignore:
Timestamp:
12/21/12 22:44:29 (12 years ago)
Author:
tmorgan
Message:

more documentation
added supported encodings listing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/bletchley-encode

    r20 r28  
    2828
    2929
    30 parser = argparse.ArgumentParser(description='A simple encoder script that is useful in shell scripts.')
    31 parser.add_argument('input_file', nargs='?', default=None,
    32                     help='File containing encrypted blobs to analyze, one per line. Omit to read from stdin.')
    33 parser.add_argument('-e', dest='encoding_chain', type=str, required=True,
    34                     help='Comma-separated sequence of encoding formats used to encode the token, starting with the last encoding to apply.')
     30parser = argparse.ArgumentParser(
     31    description='A simple encoder script that is useful in shell scripts.'
     32    ' For more information, see:  http://code.google.com/p/bletchley/wiki/Overview')
     33parser.add_argument(
     34    'input_file', nargs='?', default=None,
     35    help='File containing encrypted blobs to analyze, one per line. '
     36    'Omit to read from stdin.')
     37parser.add_argument(
     38    '-e', dest='encoding_chain', type=str, required=True,
     39    help='Comma-separated sequence of encoding formats used to encode the'
     40    ' token, starting with the last encoding to apply.'
     41    ' (Use "?" for a listing of supported encodings.)')
    3542options = parser.parse_args()
     43
     44if options.encoding_chain == '?':
     45    print('\n\t'.join(['Supported encodings:']+blobtools.supportedEncodings()))
     46    sys.exit(0)
    3647
    3748input_file = sys.stdin
     
    4354specified_encodings = options.encoding_chain.split(',')
    4455specified_encodings.reverse()
     56# XXX: report invalid encodings
    4557sys.stdout.write(blobtools.encodeChain(specified_encodings, blob))
     58sys.stdout.write('\n')
Note: See TracChangeset for help on using the changeset viewer.