Ignore:
Timestamp:
Dec 10, 2010 9:00:16 AM (13 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master
Children:
913dc7a
Parents:
fbee30a
git-author:
Ted Faber <faber@…> (12/09/10 11:41:45)
git-committer:
Ted Faber <faber@…> (12/10/10 09:00:16)
Message:

allow command line progams to expand tildes. Added a class derived from OptionParser? to make that easily available.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/confirm_sshkey.py

    rfbee30a r62f3dd9  
    33import os, sys
    44import MySQLdb
    5 from optparse import OptionParser
     5from federation.util import file_expanding_opts
    66
    77
    8 class opt_parser(OptionParser):
     8class opt_parser(file_expanding_opts):
    99    def __init__(self):
    1010        OptionParser.__init__(self, usage="%prog [opts] (--help for details)",
     
    1212        self.add_option('-u', '--user', dest='user', action='store',
    1313                default=None, help="User to confirm key of")
    14         self.add_option('-f', '--keyfile', dest='keyfile', action='store',
     14        self.add_option('-f', '--keyfile', dest='keyfile',
     15                action='callback', callback=self.expand_file, type='str',
    1516                default=None, help="file containing pubkey to confirm")
    16         self.add_option('-k', '--key', dest='key',
    17                 default=None, action='store',
     17        self.add_option('-k', '--key', dest='key', default=None,
     18                action='callback', callback=self.expand_file, type='str',
    1819                help='Key on the command line')
    1920        self.add_option('-q', '--quiet', dest='verbose', action='store_false',
Note: See TracChangeset for help on using the changeset viewer.