~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/option.py

  • Committer: IWATA Hidetaka
  • Date: 2010-12-26 13:19:11 UTC
  • mto: This revision was merged to the branch mainline in revision 5593.
  • Revision ID: iwata0303@gmail.com-20101226131911-o7txs0fnji5zekq1
add icon resources tbzrcommand(w)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2004, 2005, 2006, 2007 Canonical Ltd
 
1
# Copyright (C) 2005-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
276
276
        parser.add_option(action='callback',
277
277
                          callback=self._optparse_callback,
278
278
                          type='string', metavar=self.argname.upper(),
279
 
                          help=self.help, default=[],
 
279
                          help=self.help, dest=self._param_name, default=[],
280
280
                          *option_strings)
281
281
 
282
282
    def _optparse_callback(self, option, opt, value, parser):
364
364
        as values for the option, and their value is treated as the help.
365
365
        """
366
366
        reg = _mod_registry.Registry()
367
 
        for name, switch_help in kwargs.iteritems():
 
367
        for name, switch_help in sorted(kwargs.items()):
368
368
            name = name.replace('_', '-')
369
369
            reg.register(name, name, help=switch_help)
370
370
            if not value_switches:
530
530
               short_name='m',
531
531
               help='Message string.')
532
532
_global_option('no-recurse')
 
533
_global_option('null', short_name='0',
 
534
                 help='Use an ASCII NUL (\\0) separator rather than '
 
535
                      'a newline.')
533
536
_global_option('profile',
534
537
               help='Show performance profiling information.')
535
538
_global_option('revision',
570
573
_global_option('dry-run',
571
574
               help="Show what would be done, but don't actually do anything.")
572
575
_global_option('name-from-revision', help='The path name in the old tree.')
 
576
_global_option('directory', short_name='d', type=unicode,
 
577
               help='Branch to operate on, instead of working directory')
573
578
 
574
579
diff_writer_registry = _mod_registry.Registry()
575
580
diff_writer_registry.register('plain', lambda x: x, 'Plaintext diff output.')