[darcs-devel] [issue2371] user defined command aliases

Ben Franksen bugs at darcs.net
Tue Apr 8 20:39:34 UTC 2014


New submission from Ben Franksen <benjamin.franksen at helmholtz-berlin.de>:

I am following gh's advice [see issue2350] to turn this into an
independent proposal.

The idea is to allow users to define their own aliases for darcs
commands. Aliases are currently hard-coded, and in order to keep the
visible user interface clean and orthogonal, they are not listed by
--help or --commands. The proposal is to remove all hard-coded aliases
and instead provide a way for users to create and remove aliases at will.

One option would be a separate configuration file, as in

> cat ~/.darcs/alias
amend-unrecord amend-record --unrecord
unpull obliterate

Another option (which I find more elegant) is to extend the defaults
file syntax with an 'alias' keyword. Here are some examples:

record prompt-long-comment

This is the old style definition for a default option.

default whatsnew --interactve

The same, only with the keyword 'default' added in front, and with the
two option dashes not erased. NB, not leaving off the option dashes is
much more readable!

This is for consistency of the new syntax. For compatibility, 'default'
is the default (sic!).

alias amend-record amend --record
alias amend-unrecord amend --unrecord

These lines demonstrate alias syntax. They declare two new aliases
(amend-record and amend-unrecord) to be synonymous with 'amend' with
different options.

----------
messages: 17301
nosy: bf
priority: wishlist
status: unknown
title: user defined command aliases

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue2371>
__________________________________


More information about the darcs-devel mailing list