~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Martin Pool
  • Date: 2005-04-26 10:37:53 UTC
  • Revision ID: mbp@sourcefrog.net-20050426103753-e022129bd6afd29b
- New bzr whoami --email option

Show diffs side-by-side

added added

removed removed

Lines of Context:
705
705
        sys.exit(1)
706
706
 
707
707
 
708
 
def cmd_whoami():
 
708
def cmd_whoami(email=False):
709
709
    """Show bzr user id.
710
710
 
711
711
    usage: bzr whoami
712
712
 
713
 
    TODO: Command to show only the email-address part as parsed out.
 
713
    options:
 
714
        --email             Show only the email address.
 
715
    
714
716
    """
715
 
    print bzrlib.osutils.username()
716
 
 
717
 
 
 
717
    if email:
 
718
        print bzrlib.osutils.user_email()
 
719
    else:
 
720
        print bzrlib.osutils.username()
 
721
        
 
722
        
718
723
def cmd_gen_revision_id():
719
724
    print bzrlib.branch._gen_revision_id(time.time())
720
725
 
825
830
    'timezone':               str,
826
831
    'verbose':                None,
827
832
    'version':                None,
 
833
    'email':                  None,
828
834
    }
829
835
 
830
836
SHORT_OPTIONS = {
846
852
    'ls':                     ['revision', 'verbose'],
847
853
    'remove':                 ['verbose'],
848
854
    'status':                 ['all'],
 
855
    'whoami':                 ['email'],
849
856
    }
850
857
 
851
858