1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
aba
===
A while back, there was a suggestion that we make arch extendable with
shell scripts. I thought the idea was neat, but Tom was having none
of it. He felt that we could just write wrappers around tla to achive
the same effect.
Well, I think he was right. aba is a stupid-simple arch wrapper I
wrote, which I have named, with all due humility, Aaron Bentley's Arch.
You can use it to add new commands, set default options for any command, and
create short aliases for long tla archive/category/version/revision names.
Installing aba
==============
cd to ~/bin or /usr/local/bin
Create a symlink (ln -s) to the aba script
Why that works
==============
The main script looks for default options in <installdir>/options and
~/.aba/options. Then it looks for files in <installdir>/commands and
~/.aba/commands, and executes them if they exist. Otherwise, it executes
tla. It finds <installdir> by looking at its $0, resolving it if it's
a symlink. So it can be installed by just linking somewhere in path.
Command Scripts
===============
To list available scripts, type "aba help". This lists both tla and aba
commands.
Technically, command scripts should support the following arguments:
exec $* Does whatever the script does
exec -h Prints brief help
exec -H Prints detailed help
desc one-liner description of the script's function
Non-interactive commands should normally pipe their output through $ABAFILTER.
But I find it's easier to just copy aba/skel-command, and follow the comments.
Default Options
===============
Both tla commands and command scripts are executed with the options in the
appropriate options file prepended. Options files contain only the default
options desired. Aliases are treated as separate commands. The filename
should be the same as the command they are for.
An example is provided that prepends '--diffs' to 'what-changed'.
Aliases
=======
Aliases can be used to reduce the amount of typing required by certain
commands. Aliases can be defined in ~/.aliases like so:
tom=lord@emf.net--2004/tla--devo--1.2
Or you can use "aba alias" to list or add aliases
I've just added support for per-tree aliases, like Stefan Monnier wanted for
tla. To create them, you'll need to create a file named ++aliases in the tree
root. Sorry, "aba alias" doesn't support them yet.
They can then be used on the command line like this:
aba get ^tom--patch-35
(the ^ can be overridden by defining an alias
aliaschar=<whatever-character-you-want>)
If you need to inhibit alias processing, prepend the character twice -- ie.
^^. Aliases are disabled completely when you define aliaschar to empty.
While the intended use for aliases is to reduce the number of branch names
typed, alias expansion is applied to all command arguments, so you can get
creative with them if you like. Please don't put anything other than simple
variable assignments in the file. Pretty please.
Filtering output
===============
aba can optionally pass its output through a filter. To select this filter,
export a variable named "ABAFILTER", with the command to be used. An obvious
example would be export ABAFILTER="aba colorize", but less, more and other
output filters can be used.
Interactive aba commands (e.g. those that may invoke $EDITOR) are not filtered.
All tla commands are filtered, but $EDITOR is unset before invoking tla with
a filter.
aba's web site
==============
Check out all the latest info, screenshots and Winamp themes at the web site:
http://sourcecontrol.net/~abentley/aba.php
Comments, suggestions, and scripts are welcome.
Aaron
Aaron Bentley
abentley@panoramicfeedback.com
|