~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: mbp at sourcefrog
  • Date: 2005-03-24 01:13:50 UTC
  • Revision ID: mbp@sourcefrog.net-20050324011350-441e5dca7b24c112
Can now say "bzr help COMMAND" for more detailed help

Show diffs side-by-side

added added

removed removed

Lines of Context:
503
503
# help
504
504
 
505
505
 
506
 
def cmd_help():
507
 
    # TODO: Specific help for particular commands
508
 
    print __doc__
 
506
def cmd_help(topic=None):
 
507
    if topic == None:
 
508
        print __doc__
 
509
        return
 
510
 
 
511
    # otherwise, maybe the name of a command?
 
512
    try:
 
513
        cmdfn = globals()['cmd_' + topic.replace('-', '_')]
 
514
    except KeyError:
 
515
        bailout("no help for %r" % topic)
 
516
 
 
517
    doc = cmdfn.__doc__
 
518
    if doc == None:
 
519
        bailout("sorry, no detailed help yet for %r" % topic)
 
520
 
 
521
    print doc
 
522
        
 
523
 
509
524
 
510
525
 
511
526
def cmd_version():
564
579
 
565
580
 
566
581
cmd_args = {
567
 
    'init':                   [],
568
582
    'add':                    ['file+'],
569
583
    'commit':                 [],
570
584
    'diff':                   [],
 
585
    'export':                 ['revno', 'dest'],
571
586
    'file-id':                ['filename'],
572
 
    'root':                   ['filename?'],
573
 
    'relpath':                ['filename'],
574
587
    'get-file-text':          ['text_id'],
575
588
    'get-inventory':          ['inventory_id'],
576
589
    'get-revision':           ['revision_id'],
577
590
    'get-revision-inventory': ['revision_id'],
 
591
    'help':                   ['topic?'],
 
592
    'init':                   [],
578
593
    'log':                    [],
579
594
    'lookup-revision':        ['revno'],
580
 
    'export':                 ['revno', 'dest'],
 
595
    'relpath':                ['filename'],
581
596
    'remove':                 ['file+'],
 
597
    'root':                   ['filename?'],
582
598
    'status':                 [],
583
599
    }
584
600