~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Martin Pool
  • Date: 2008-04-11 07:18:46 UTC
  • mfrom: (3346.2.9 make-dist)
  • mto: (3360.3.1 1.4)
  • mto: This revision was merged to the branch mainline in revision 3385.
  • Revision ID: mbp@sourcefrog.net-20080411071846-3rhfzykpyhhln6sl
merge 'make dist' and 'version --short'

Show diffs side-by-side

added added

removed removed

Lines of Context:
2719
2719
    """Show version of bzr."""
2720
2720
 
2721
2721
    encoding_type = 'replace'
 
2722
    takes_options = [
 
2723
        Option("short", help="Print just the version number."),
 
2724
        ]
2722
2725
 
2723
2726
    @display_command
2724
 
    def run(self):
 
2727
    def run(self, short=False):
2725
2728
        from bzrlib.version import show_version
2726
 
        show_version(to_file=self.outf)
 
2729
        if short:
 
2730
            self.outf.write(bzrlib.version_string + '\n')
 
2731
        else:
 
2732
            show_version(to_file=self.outf)
2727
2733
 
2728
2734
 
2729
2735
class cmd_rocks(Command):