How to add a new darcs command

We need to be cautious in adding new darcs commands to avoid cluttering up the interface, but it's quite simple to actually add a new command. This page will describe how this is done, and perhaps introduce a bit of the organization of darcs' source code in the process.

  1. Copy an existing command file to create a new module:
    •   cp Add.lhs Foo.lhs
        
  2. Rename module within that file
    •   darcs replace Add Foo Foo.lhs
        darcs replace add foo Foo.lhs
        
  3. Add new file to GNUMakefile (please keep the list of files alphebetized).
  4. Add new module and code to TheCommands.lhs (should be pretty obvious).

  5. Add "\input{Foo.lhs}" to darcs.lhs in an appropriate section of the manual (this adds your command to the manual).
  6. Modify the documentation in Foo.lhs to describe your command.
  7. Make the command in Foo.lhs do what you actually want.

Note that you'll most likely want to modify the list of flags supported by your command. If you choose wisely the command you duplicate, you may not need to modify much. Also note that you may need to define new flags, which is done in DarcsArguments.lhs.

DarcsWiki: AddACommand (last edited 2007-10-09 14:47:20 by EricKow)