Migrated from creating-and-installing-add-ons v6

inkarkat
2010-09-13 01:26:18 -07:00
parent 92ca368368
commit be885d157f

@@ -2,20 +2,19 @@ Todo.sh add-ons let you add new todo.sh actions or change (override) default act
h2. Installing Add-ons h2. Installing Add-ons
Add-ons must be installed into the .todo/actions/ sub-directory of your home directory. Create this directory with the following bash shell commands: Add-ons can be installed into the $HOME/.todo.actions.d directory, or any other directory configured via $TODO_ACTIONS_DIR. Create this directory with the following bash shell commands:
<pre> <pre>
cd mkdir -p ~/.todo.actions.d
mkdir .todo/actions
</pre> </pre>
You must name add-ons after the action you want to add or override. For You must name add-ons after the action you want to add or override. For
example, create a new "review" action by installing an add-on to example, create a new "review" action by installing an add-on to
.todo/actions/review. After installing the add-on, you must make it .todo.actions.d/review. After installing the add-on, you must make it
executable; for example: executable; for example:
<pre> <pre>
chmod +x .todo/actions/review chmod +x ~/.todo.actions.d/review
</pre> </pre>
Use the new or overridden action the normal todo.sh way. For example: Use the new or overridden action the normal todo.sh way. For example:
@@ -75,11 +74,10 @@ h2. Aliasing Add-ons
You may want to allow short aliases for those new commands (e.g. "pv" as alias for "projectview") You may want to allow short aliases for those new commands (e.g. "pv" as alias for "projectview")
There is a small issue if you simply duplicate or symlink the add-on file: the corresponding help snippet will be duplicated as well in the output of the todo.sh help command. To avoid that, you can create aliases by creating short add-ons such as this example (replace projectview by the command you want to call with your alias): There is a small issue if you simply duplicate or symlink the add-on file: the corresponding help snippet will be duplicated as well in the output of the todo.sh help command. To avoid that, you can create aliases by creating short add-ons such as this example (replace projectview by the command you want to call with your alias):
<pre> <pre>
#!/bin/bash #!/bin/bash
[ "$1" = "usage" ] && exit 0 [ "$1" = "usage" ] && exit 0
shift shift
"$TODO_FULL_SH" projectview "$@"
"$TODO_SH" projectview "$@"
</pre> </pre>