Skip to content

Commit

Permalink
add description of command_aliases to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Kundert authored and Ken Kundert committed Jan 11, 2025
1 parent 94cef1c commit f35e75b
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 2 deletions.
2 changes: 1 addition & 1 deletion assimilate/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -2270,7 +2270,7 @@ class RepoListCommand(Command):
oldest+range
-e, --include-external list all archives in repository, not just
those associated with chosen configuration
-d, --deleted only archives archives marked for deletion
-d, --deleted only consider archives marked for deletion
By default all archives will listed, however you can limit the
number shown using various command line options.
Expand Down
64 changes: 63 additions & 1 deletion doc/configuring.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,14 @@ It might look like the following:
create: backup
repo-list:
- archives
- a
- recent --last=20
list: paths
list:
- l
- ln -N
- ls -S
- ld -D
overdue: od
umount: unmount
logging:
Expand Down Expand Up @@ -634,6 +640,62 @@ is not colored. In general it is best to use the "light" colorscheme on dark
backgrounds and the "dark" colorscheme on light backgrounds.


command aliases
~~~~~~~~~~~~~~~

This collection of settings allows you to choose the names and options you use
for the various commands available in *Assimilate*. It takes the following
form:

.. code-block:: nestedtext
command aliases:
create: backup
repo-list:
- archives
- a
- recent --last=20
list:
- l
- ln -N
- ls -S
- ld -D
overdue: od
umount: unmount
The *command_aliases* setting takes a collection of key-value pairs, where the
key is the name of the *Assimilate* command you wish to personalize. The value
is a list of aliases for that command. Each list item includes the desired name
and desired command line options. If there is only one item in the list, it can
be given on the same line as the key. So for example:

.. code-block:: nestedtext
command aliases:
create: backup
This simply adds an alternative name for the *create* command. You might do
this to allow yourself to use a name that is more comfortable for you, as with
*backup* or *archives*, or to make a command you use often easier to type, as
with *l* or *od*.

You can customize the behavior of the command when invoked with an alias by
adding command line arguments. For example:

.. code-block:: nestedtext
command aliases:
list:
- l
- ln -N
- ls -S
- ld -D
Besides creating a simple alias for the *list* command, this also creates three
new versions: *ln* sorts the listed files by name, *ls* sorts them by size, and
*ld* sorts them by date.


.. _compact_after_delete:

compact_after_delete
Expand Down

0 comments on commit f35e75b

Please sign in to comment.