com_afs_rm(): Implement pattern matching and add -v, -p, -f flags.
[paraslash.git] / afs.cmd
1 OF: afs_command_list
2 SF: afs.c aft.c attribute.c
3 HC: Prototypes for the commands of the audio file selector.
4 CC: Array of commands for the audio file selector.
5 AT: server_command
6 IN: para afh server list user_list
7 SN: list of afs commands
8 TM: mood lyr img pl
9 ---
10 N: add
12 D: Add new audio files to the database.
13 U: add [-l] [-f] [-v] path1 ...
14 H: Each given path may be either the full path to an audio file, or the full path
15 H: of a directory. In case of a directory, all audio files in that directory
16 H: are added recursively.
17 H:
18 H: Options:
19 H:
20 H: -l Add files lazily. If a file already exists in the database, skip this file.
21 H: This operation is really cheap. Use it when adding large directories if only a
22 H: few files where added.
23 H:
24 H:-f Force adding/updating. Recompute the audio format handler data
25 H: even if a file with the same path and the same hash value exists.
26 H:
27 H: -v Verbose mode. Print what is being done.
28 ---
29 N: init
31 D: Initialize the osl tables for the audio file selector.
32 U: init [table_name ...]
33 H: When invoked without arguments, this command creates all tables. Otherwise
34 H: only the tables given by table_name... are created.
35 ---
36 N: afs_ls
38 D: List audio files.
39 U: ls [-l[s|l|v|m]] -p -a -r -s{p|s|l|n|f|c|i|y|b|d|a} [pattern...]
40 H: Print a list of all audio files matching pattern.
41 H:
42 H: Options:
43 H:
44 H: -l Change listing mode. Defaults to short listing if not given.
45 H: -ls: short listing mode
46 H: -ll: long listing mode (equivalent to -l)
47 H: -lv: verbose listing mode
48 H: -lm: mbox listing mode
49 H:
50 H: -p List full path of audio file. If not specified, only the basename
51 H: of each file is printed.
52 H:
53 H: -a List only file that are admissible with respect to the current mood or
54 H: playlist.
55 H:
56 H: -r Reverse sort order.
57 H:
58 H: -s Change sort order. Defaults to alphabetical path sort if not given.
59 H:
60 H: -sp: sort by path.
61 H:
62 H: -sl: sort by last played time.
63 H:
64 H: -ss: sort by score (implies -a).
65 H:
66 H: -sn: sort by num played count.
67 H:
68 H: -sf: sort by frequency.
69 H:
70 H: -sc: sort by number of channels.
71 H:
72 H: -si: sort by image id.
73 H:
74 H: -sy: sort by lyrics id.
75 H:
76 H: -sb: sort by bitrate.
77 H:
78 H: -sd: sort by duration.
79 H:
80 H: -sa: sort by audio format.
81 ---
82 N: lsatt
84 D: List attributes
85 U: lsatt [-a] [-l]
86 H:
87 H: Print the list of all defined attributes.
88 H:
89 H: Options:
90 H:
91 H: -a Sort attributes alphabetically by name. The default is to sort by
92 H: identifier.
93 H:
94 H: -l Print a long listing containing both identifier and attribute name. The
95 H: default is to print only the name.
96 ---
97 N: setatt
99 D: Set attribute(s) for all files matching a pattern.
100 U: setatt attribute{+|-}... pattern
101 H: Set ('+') or unset ('-') the given attributes for all audio files matching
102 H: pattern. Example:
103 H:
104 H: sa rock+ punk+ classic- '*foo.mp3'
105 H:
106 H: sets the 'rock' and the 'punk' attribute but unsets the 'classic'
107 H: attribute of all files ending with 'foo.mp3'.
108 ---
109 N: addatt
111 D: Add new attribute(s).
112 U: addatt attribute1 [attribute2 ...]
113 H: This adds new attributes to the attribute table. At most 64 attributes
114 H: may be defined.
115 ---
116 N: check
118 D: Run integrity checks against osl tables.
119 U: check [-a] [-m] [-p]
120 H: This command checks the audio file table, the mood definitions and all
121 H: defined playlists and reports any inconsistencies found.
122 H:
123 H: Options:
124 H:
125 H: -a Run audio file table checks. Checks for entries in the audio file
126 H: table which are not present in the filesystem. Moreover, it checks
127 H: whether the lyrics id and all entries in the audio file table are
128 H: valid.
129 H:
130 H: -m Run syntax checks on all defined moods in the mood table.
131 H:
132 H: -p Check all playlists for lines that correspond to files not contained
133 H: in the audio file table.
134 H:
135 H: If called without arguments, all three checks are run.
136 ---
137 N: rmatt
139 D: Remove attribute(s).
140 U: rmatt pattern...
141 H: Remove all attributes matching any given pattern. All information
142 H: about this attribute in the audio file table is lost.
143 ---
144 N: afs_rm
146 D: Remove entries from the audio file table.
147 U: rm [-v] [-f] [-p] pattern...
148 H: Delete all entries in the audio file table that match any given pattern.
149 H: Note that affects the table entries only; paraslash won't touch your
150 H: audio files in any way.
151 H: Options:
152 H:
153 H: -v Verbose mode. Explain what is being done.
154 H:
155 H: -f Force mode. Ignore nonexistent files. Don't complain if nothing
156 H: was removed.
157 H:
158 H: -p Pathname match. Match a slash in the path only with a slash
159 H: in pattern and not by an asterisk (*) or a question mark
160 H: (?) metacharacter, nor by a bracket expression ([]) containing
161 H: a slash (see fnmatch(3)).
162 ---
163 N: touch
165 D: Manupulate the afs data for all audio files matching a pattern.
166 U: touch [-n numplayed] [-l lastplayed] [-y lyrics_id] [-i image_id] pattern
167 H: If no option is given, lastplayed is set to the current time and numplayed is
168 H: increased by one. Otherwise, only the given options are taken into account.
169 H:
170 H: Options:
171 H:
172 H: -n Set numplayed count. The number of times afs has selected this
173 H: audio file for streaming.
174 H:
175 H: -l Set lastplayed time. The last time this audio file was selected.
176 H: Must be given as the number of sectonds since the epoch. Example:
177 H:
178 H: touch -l $(date +%s) file
179 H:
180 H: sets the lastplayed time of 'file' to the current time.
181 H:
182 H: -y Set the lyrics id. Specify the lyrics data file associated with
183 H: this audio file.
184 H:
185 H: -i Set the image id. Same as -y, but sets the image.
186 ---
187 T: add
188 N: add@member@
189 O: int com_add@member@(int fd, int argc, char * const * const argv);
191 D: Read data from stdin and add it as a blob to an osl table.
192 U: add@member@ @member@_name
193 H: Each command of this family reads arbitrary binary data from stdin and sends
194 H: that data to the audio file selector process. The afs process then creates a
195 H: new blob for the data in the corresponding osl table. Example:
196 H:
197 H: addimg foo.jpg < bar.jpg
198 H:
199 H: adds the contents of the file 'bar.jpg' as a blob named 'foo.jpg' to the image
200 H: table. The names of the blobs of a table must be unique, i.e. it is an error
201 H: if an entry named 'foo.jpg' already exists.
202 ---
203 T: cat
204 N: cat@member@
205 O: int com_cat@member@(int fd, int argc, char * const * const argv);
207 D: Dump the contents of a blob to stdout.
208 U: cat@member@ @member@_name
209 H: These commands may be used to retrieve the blob identified by the given name from
210 H: the corresponding osl table to which they were previously added.
211 ---
212 T: ls
213 N: ls@member@
214 O: int com_ls@member@(int fd, int argc, char * const * const argv);
216 D: List blobs of an osl table matching a pattern.
217 U: ls@member@ [-v] [pattern]
218 H: Print a list of the names of all blobs in the corresponding osl table which
219 H: match the given pattern. If no pattern is given, the full list is printed. If
220 H: the optional -v pattern is given, the blob id is printed as well.
221 ---
222 T: rm
223 N: rm@member@
224 O: int com_rm@member@(int fd, int argc, char * const * const argv);
226 D: Remove blob(s) from an osl table.
227 U: rm@member@ pattern...
228 H: Remove all blobs from the corresponding table which match any given pattern.
229 ---
230 T: mv
231 N: mv@member@
232 O: int com_mv@member@(int fd, int argc, char * const * const argv);
234 D: Rename a blob.
235 U: mv@member@ old_@member@_name new_@member@_name
236 H: Rename the blob identified by the first name as the second name.