]> git.tuebingen.mpg.de Git - paraslash.git/blob - m4/lls/server_cmd.suite.m4
Introduce lsu.{c,h}, implement help --long for para_server.
[paraslash.git] / m4 / lls / server_cmd.suite.m4
1 [suite server_cmd]
2 caption = list of server commands
3 aux_info_prefix = Permissions:
4
5 [introduction]
6         The server process listens on a network socket and accepts connections
7         from para_client or para_audiod. For the connection to succeed the
8         connecting peer must authenticate as one of the users stored in the
9         user table of para_server. Each entry of the user table contains the
10         set of permission bits that are granted to the user. Authenticated
11         users may execute one of the commands below if the set of permission
12         bits of the command is a subset of the permission bits that are
13         granted to the user.
14 [/introduction]
15
16 [subcommand add]
17         purpose = add or update audio files
18         non-opts-name = path...
19         aux_info = AFS_READ | AFS_WRITE
20         [description]
21                 Each path must be absolute and refer to either an audio file or a
22                 directory. In case of a directory, all audio files in that directory
23                 are added recursively. Note that the given paths refer to files or
24                 directories on the host on which para_server is running.
25         [/description]
26         [option all]
27                 short_opt = a
28                 summary = add all files
29                 [help]
30                         The default is to add only files ending in a known suffix for a
31                         supported audio format.
32                 [/help]
33         [option lazy]
34                 short_opt = l
35                 summary = add files lazily
36                 [help]
37                         If the path already exists in the database, skip this file. This
38                         operation is really cheap. Useful to update large directories after
39                         some files have been added.
40                 [/help]
41         [option force]
42                 short_opt = f
43                 summary = force adding/updating
44                 [help]
45                         Recompute the audio format handler data even if a file with the same
46                         path and the same hash value exists.
47                 [/help]
48         [option verbose]
49                 short_opt = v
50                 summary = enable verbose mode
51                 [help]
52                         Print what is being done.
53                 [/help]
54
55 [subcommand addatt]
56         purpose = add new attribute(s)
57         non-opts-name = attribute...
58         aux_info = AFS_READ | AFS_WRITE
59         [description]
60                 This adds new attributes to the attribute table. At most 64 attributes
61                 may be defined.
62         [/description]
63
64 [subcommand check]
65         purpose = run integrity checks on database tables
66         aux_info = AFS_READ
67         [description]
68                 If no options are given, all checks are run.
69         [/description]
70         [option aft]
71                 short_opt = a
72                 summary = run audio file table checks
73                 [help]
74                         Report stale paths and invalid image and lyrics ids of the audio
75                         file table.
76                 [/help]
77         [option attribute]
78                 short_opt = A
79                 summary = check for invalid attributes
80                 [help]
81                         Report audio files whose attribute bitmask is invalid, i.e., has a bit
82                         set which does not correspond to any attribute of the attribute table.
83                 [/help]
84         [option mood]
85                 short_opt = m
86                 summary = check for invalid mood definitions
87                 [help]
88                         Run syntax checks on all moods of the mood table.
89                 [/help]
90         [option playlist]
91                 short_opt = p
92                 summary = find invalid paths in playlists
93                 [help]
94                         Check all playlists for paths not contained in the audio file table.
95                 [/help]
96
97 [subcommand cpsi]
98         purpose = copy selected parts of the audio file selector info
99         non-opts-name = source pattern...
100         aux_info = AFS_READ | AFS_WRITE
101         [description]
102                 If no option, or only --verbose is given, all fields of the audio
103                 file selector info structure are copied to each row of the audio file
104                 table whose path matches at least one of the given patterns. Otherwise,
105                 only those fields which correspond to the given options are copied.
106         [/description]
107         [option attribute-bitmap]
108                 short_opt = a
109                 summary = copy the attribute bitmap
110         [option image-id]
111                 short_opt = i
112                 summary = copy the image id
113         [option lyrics-id]
114                 short_opt = y
115                 summary = copy the lyrics id
116         [option lastplayed]
117                 short_opt = l
118                 summary = copy the lastplayed timestamp
119         [option numplayed]
120                 short_opt = n
121                 summary = copy the numplayed counter
122         [option verbose]
123                 short_opt = v
124                 summary = enable verbose mode
125
126 [subcommand ff]
127         purpose = jump N seconds forward or backward
128         synopsis = n[-]
129         aux_info = VSS_READ | VSS_WRITE
130         [description]
131                 This sets the 'R' (reposition request) bit of the vss status flags
132                 which enqueues a request to jump n seconds forwards or backwards.
133
134                 Example:
135
136                      para_client ff 30-
137
138                 jumps 30 seconds backwards.
139
140         [/description]
141
142 [subcommand help]
143         purpose = list available commands or print command-specific help
144         non-opts-name = [command]
145         aux_info = NO_PERMISSION_REQUIRED
146         [description]
147                 When executed without any arguments, the available server commands
148                 are listed. Otherwise, if the first argument is the name of a server
149                 command, the description of this command is shown.
150         [/description]
151         m4_include(`long-help.m4')
152
153 [subcommand hup]
154         purpose = reload config file, log file and user list
155         aux_info = VSS_WRITE
156         [description]
157                 Reread the config file and the user list file, close and reopen the log
158                 file, and ask the afs process to do the same. Sending the HUP signal
159                 to the server process has the same effect as running this command.
160         [/description]
161
162 [subcommand init]
163         purpose = initialize the database tables for the audio file selector
164         synopsis = [table_name...]
165         aux_info = AFS_READ | AFS_WRITE
166         [description]
167                 When invoked without arguments, this command creates all
168                 tables: audio_files, attributes, scores, moods, lyrics, images,
169                 playlists. Otherwise only the given tables are created.
170         [/description]
171
172 [subcommand jmp]
173         purpose = reposition the current stream
174         non-opts-name = n
175         aux_info = VSS_READ | VSS_WRITE
176         [description]
177                 Set the 'R' (reposition request) bit of the vss status flags and
178                 enqueue a request to jump to n% of the current audio file, where 0 <=
179                 n <= 100.
180         [/description]
181
182 [subcommand ls]
183         purpose = list audio files which match a pattern
184         non-opts-name = [pattern...]
185         aux_info = AFS_READ
186         [description]
187                 If no pattern is given, all files are listed.  Otherwise, the command
188                 lists all files of the audio file table whose path matches at least
189                 one of the given patterns.
190         [/description]
191         [option listing-mode]
192                 short_opt = l
193                 summary = use alternative output format
194                 arg_type = string
195                 arg_info = optional_arg
196                 typestr = mode
197                 default_val = long
198                 [help]
199                         The optional mode argument is either a single character or a word
200                         according to the following list.
201
202                         short (s). List only the path or basename (last component of the path),
203                         depending on whether -p is also given. This listing mode acts as if
204                         --listing-mode had not been given.
205
206                         long (l). Show detailed information. This is the default if no argument
207                         to --listing-mode is supplied.
208
209                         verbose (v). Multi-line output, one row per data field stored in the
210                         audio file table.
211
212                         parser-friendly (p). Like verbose listing mode, but use numerical
213                         values for the names of the output fields and prefix each line with
214                         a length field.
215
216                         mbox (m). Generate output suitable to be viewed with a mail
217                         program. One "mail" per matching audio file.
218
219                         chunk-table (c). Print path (or basename, depending on whether -p is
220                         also given), chunk time and chunk offsets.
221
222                 [/help]
223         [option basename]
224                 short_opt = b
225                 summary = list and match basenames only
226                 [help]
227                         Print only the basename of each matching file and match only the
228                         basenames of the paths stored in the audio file table against the
229                         given patterns. The default is to print and match the full path.
230                 [/help]
231         [option admissible]
232                 short_opt = a
233                 summary = list only admissible files
234                 [help]
235                         List only files which are admissible with respect to the current mood
236                         or playlist.
237                 [/help]
238         [option reverse]
239                 short_opt = r
240                 summary = reverse sort order
241         [option unix-date]
242                 short_opt = d
243                 summary = print dates as seconds after the epoch
244         [option sort]
245                 short_opt = s
246                 summary = change sort order
247                 arg_type = string
248                 arg_info = required_arg
249                 typestr = order
250                 default_val = path
251                 [help]
252                         The sort order must be given as an required argument. Like for
253                         --listing-mode, this argument may either be a single character or a
254                         word, according to the following list.
255
256                         path (p). Sort alphabetically by path or basename, depending on
257                         whether -b is given. This is the default if --sort is not given.
258
259                         score (s). Iterate over the entries of the score table, rather than
260                         the audio file table. This sort order implies --admissible, since
261                         the score table contains only admissible files.
262
263                         lastplayed (l)
264
265                         numplayed (n)
266
267                         frequency (f)
268
269                         channels (c)
270
271                         image-id (i)
272
273                         lyrics-id (y)
274
275                         bitrate (b)
276
277                         duration (d)
278
279                         audio-format (a)
280
281                         hash (h)
282
283                         If --sort is not given, path sort is implied.
284                 [/help]
285
286 [subcommand lsatt]
287         purpose = list attributes
288         aux_info = AFS_READ
289         [description]
290                 Print the list of all defined attributes which match the given
291                 pattern. If no pattern is given, the full list is printed.
292         [/description]
293
294         [option id-sort]
295                 short_opt = i
296                 summary = sort attributes by id
297                 [help]
298                         The default is to sort alphabetically by name.
299
300                         Attributes are internally represented as an 64 bit array. The attribute
301                         id is the bit number in this array.
302                 [/help]
303         [option long]
304                 short_opt = l
305                 summary = print long listing
306                 [help]
307                         The long listing prints the attribute id in addition to the name of
308                         the attribute. The id is printed as a decimal number and is separated
309                         from the name by a tab character.
310                 [/help]
311         [option reverse]
312                 short_opt = r
313                 summary = reverse sort order
314
315 [subcommand mvatt]
316         purpose = rename an attribute
317         synopsis = source dest
318         aux_info = AFS_READ | AFS_WRITE
319         [description]
320                 Rename the attribute given by the first argument to the destination
321                 given by the second argument. It is an error if the destination
322                 attribute exists.
323         [/description]
324
325 [subcommand next]
326         purpose = close the stream and start to stream the next audio file
327         aux_info = VSS_READ | VSS_WRITE
328         [description]
329                 Set the 'N' (next audio file) bit of the vss status flags. This
330                 instructs the server to close the current stream, if any. The 'P'
331                 (playing) bit is not modified by this command. If it is on, playing
332                 continues with the next audio file.
333
334                 This command is equivalent to stop if paused, and has no effect
335                 if stopped.
336         [/description]
337
338 [subcommand nomore]
339         purpose = stop playing after current audio file
340         aux_info = VSS_READ | VSS_WRITE
341         [description]
342                 Set the 'O' (no more) bit of the vss status flags which asks
343                 para_server to clear the 'P' (playing) bit after the 'N' (next audio
344                 file) bit transitions from off to on (because the end of the current
345                 audio file is reached). Use this command instead of stop if you don't
346                 like sudden endings.
347         [/description]
348
349 [subcommand pause]
350         purpose = suspend the current stream
351         aux_info = VSS_READ | VSS_WRITE
352         [description]
353                 Clear the 'P' (playing) bit of the vss status flags.
354         [/description]
355
356 [subcommand play]
357         purpose = start or resume playback
358         aux_info = VSS_READ | VSS_WRITE
359         [description]
360                 Set the 'P' (playing) bit of the vss status flags.
361         [/description]
362
363 [subcommand rm]
364         purpose = remove rows from the audio file table
365         non-opts-name = pattern...
366         aux_info = AFS_READ | AFS_WRITE
367         [description]
368                 Remove all rows of the audio file table which match any of the given
369                 patterns. Note that this affects only the database table; the command
370                 won't touch your audio files on disk.
371         [/description]
372         [option verbose]
373                 short_opt = v
374                 summary = print paths of deleted rows
375         [option force]
376                 short_opt = f
377                 summary = don't complain if nothing was removed
378         [option pathname-match]
379                 short_opt = p
380                 summary = modify matching behaviour
381                 [help]
382                         Match a slash in the path only with a slash in pattern and not by an
383                         asterisk (*) or a question mark (?) metacharacter, nor by a bracket
384                         expression ([]) containing a slash (see fnmatch(3)).
385                 [/help]
386
387 [subcommand rmatt]
388         purpose = remove attribute(s)
389         non-opts-name = pattern...
390         aux_info = AFS_READ | AFS_WRITE
391         [description]
392                 Remove all attributes which match any given pattern. All information
393                 about the removed attributes in the audio file table is lost.
394         [/description]
395
396 [subcommand select]
397         purpose = activate a mood or a playlist
398         non-opts-name = specifier/name
399         aux_info = AFS_READ | AFS_WRITE
400         [description]
401                 The specifier is either 'm' or 'p' to indicate whether a playlist or
402                 a mood should be activated. Example:
403
404                         select m/foo
405
406                 activates the mood named 'foo'.
407         [/description]
408
409 [subcommand sender]
410         purpose = control paraslash senders
411         synopsis = [sender cmd [arguments]]
412         aux_info = VSS_READ | VSS_WRITE
413         [description]
414                 Send a command to a specific sender. The following commands are
415                 available, but not all senders support every command.
416
417                        help, on, off, add, delete, allow, deny, status.
418
419                 The help command prints the help text of the given sender. If no
420                 command is given the list of available senders is shown.
421
422                 Example:
423
424                         para_client sender http help
425
426         [/description]
427
428 [subcommand setatt]
429         purpose = set or unset attributes
430         synopsis = attribute{+|-}... pattern...
431         aux_info = AFS_READ | AFS_WRITE
432         [description]
433                 Set ('+') or unset ('-') the given attributes for all audio files
434                 matching the given pattern. Example:
435
436                         setatt rock+ punk+ pop- '*foo.mp3'
437
438                 sets the 'rock' and the 'punk' attribute and unsets the 'pop' attribute
439                 of all files ending with 'foo.mp3'.
440         [/description]
441
442 [subcommand si]
443         purpose = print server info
444         aux_info = NO_PERMISSION_REQUIRED
445         [description]
446                 Show server and afs PID, number of connections, uptime and more.
447         [/description]
448
449 [subcommand stat]
450         purpose = print information about the current audio file
451         aux_info = VSS_READ
452         [option num]
453                 short_opt = n
454                 summary = number of times to show the status info
455                 arg_info = required_arg
456                 arg_type = uint32
457                 typestr = num
458                 [help]
459                         Exit after the status information has been shown num times. If this
460                         option is not given, the command runs in an endless loop.
461                 [/help]
462         [option parser-friendly]
463                 short_opt = p
464                 summary = enable parser-friendly output
465                 [help]
466                         Show status item identifiers as numerical values and prefix each
467                         status item with its size in bytes.
468                 [/help]
469
470 [subcommand stop]
471         purpose = stop playback
472         aux_info = VSS_READ | VSS_WRITE
473         [description]
474                 Clear the 'P' (playing) bit and set the 'N' (next audio file) bit of
475                 the vss status flags, effectively stopping playback.
476         [/description]
477
478 [subcommand tasks]
479         purpose = list active server tasks (deprecated)
480         aux_info = NO_PERMISSION_REQUIRED
481         [description]
482                 This used to print the ID, the status and the name of each task,
483                 mainly for debugging purposes. As of version 0.6.2, the subcommand
484                 prints nothing. It will be removed in 0.7.0. Don't use.
485         [/description]
486
487 [subcommand term]
488         purpose = ask the server to terminate
489         aux_info = VSS_READ | VSS_WRITE
490         [description]
491                 Shut down the server. Instead of this command, you can also send
492                 SIGINT or SIGTERM to the para_server process. It should never be
493                 necessary to send SIGKILL.
494         [/description]
495
496 [subcommand touch]
497         purpose = manipulate the afs information of audio files
498         non-opts-name = pattern...
499         aux_info = AFS_READ | AFS_WRITE
500         [description]
501                 This command modifies the afs info structure of all rows of the audio
502                 file table whose path matches at least one of the given patters.
503
504                 If at least one option is given which takes a number as its argument,
505                 only those fields of the afs info structure are updated which
506                 correspond to the given options while all other fields stay unmodified.
507
508                 If no such option is given, the lastplayed field is set to the current
509                 time and the value of the numplayed field is increased by one while
510                 all other fields are left unchanged. This mimics what happens when
511                 the virtual streaming system selects the file for streaming.
512
513                 If the file is admissible for the current mood (or contained in the
514                 current playlist), its score is recomputed according to the changed
515                 values.
516         [/description]
517         [option numplayed]
518                 short_opt = n
519                 summary = set the numplayed count manually
520                 arg_type = uint32
521                 arg_info = required_arg
522                 typestr = num
523                 [help]
524                         The numplayed count of an audio file is the number of times the file
525                         was selected for streaming. It is one of the inputs to the scoring
526                         function which determines the order in which admissible files are
527                         streamed.
528
529                         The virtual streaming system increases this number automatically each
530                         time it opens the file for streaming.
531                 [/help]
532         [option lastplayed]
533                 short_opt = l
534                 summary = set the lastplayed time manually
535                 arg_type = uint64
536                 arg_info = required_arg
537                 typestr = num
538                 [help]
539                         The lastplayed time of an audio file is the time when the file was
540                         last opened for streaming.
541
542                         Like the numplayed count, it is an input for the scoring function
543                         and is updated automatically by the virtual streaming system.
544
545                         The argument must be a number of seconds since the epoch. Example:
546
547                                 touch -l=$(date +%s) file
548
549                         sets the lastplayed time of 'file' to the current time.
550                 [/help]
551         [option image-id]
552                 short_opt = i
553                 summary = set the image id
554                 arg_type = uint32
555                 arg_info = required_arg
556                 typestr = num
557                 [help]
558                         The afs info structure of each row of the audio file table contains
559                         a slot for the image id of the audio file that corresponds to the
560                         row. The image id stored in this slot refers to the key in the image
561                         table that identifies the blob.
562
563                         When a new audio file is added to the audio file table, its image
564                         id starts out as zero, indicating that there is no image associated
565                         with the file. Setting the image id to a non-zero number associates
566                         the file with a particular blob of the image table, for example the
567                         cover art of the album in jpg format.
568                 [/help]
569         [option lyrics-id]
570                 short_opt = y
571                 summary = set the lyrics id
572                 arg_type = uint32
573                 arg_info = required_arg
574                 typestr = num
575                 [help]
576                         This option works just like --image-id, but sets the lyrics ID rather
577                         than the image id.
578                 [/help]
579         [option amp]
580                 short_opt = a
581                 summary = set the amplification value (0-255)
582                 arg_type = uint32
583                 arg_info = required_arg
584                 typestr = num
585                 [help]
586                         The amplification value of an audio file is a number which is stored
587                         in the afs info structure.
588
589                         The value determines the scaling factor by which the amplitude of
590                         the decoded samples should be multiplied in order to normalize the
591                         volume. A value of zero means no amplification, 64 means the amplitude
592                         should be multiplied by a factor of two, 128 by three and so on.
593
594                         The amp filter of para_audiod amplifies the volume according to
595                         this value.
596                 [/help]
597         [option verbose]
598                 short_opt = v
599                 summary = explain what is being done
600         [option pathname-match]
601                 short_opt = p
602                 summary = modify matching behaviour
603                 [help]
604                         Match a slash in the path only with a slash in pattern and not by an
605                         asterisk (*) or a question mark (?) metacharacter, nor by a bracket
606                         expression ([]) containing a slash (see fnmatch(3)).
607                 [/help]
608
609 [subcommand version]
610         purpose = print the git version string of para_server
611         aux_info = NO_PERMISSION_REQUIRED
612         [option verbose]
613                 short_opt = v
614                 summary = print detailed (multi-line) version text
615
616 m4_define(`BLOB_COMMANDS', `
617 [subcommand rm`$2']
618         purpose = remove `$1' blob(s)
619         non-opts-name = pattern...
620         aux_info = AFS_READ | AFS_WRITE
621         [description]
622                 Remove all `$1' blobs which match any of the given patterns.
623         [/description]
624
625 [subcommand mv`$2']
626         purpose = rename `$1' blob(s)
627         non-opts-name = source dest
628         aux_info = AFS_READ | AFS_WRITE
629         [description]
630                 Rename `$1' source to dest. The command fails if the source `$1'
631                 does not exist or if the destination `$1' already exists.
632         [/description]
633
634 [subcommand add`$2']
635         purpose = add a blob to the `$1' table
636         non-opts-name = `$1'_name
637         aux_info = AFS_READ | AFS_WRITE
638         [description]
639                 Read from stdin and ask the audio file selector to create a blob in
640                 the `$1' table. If the named blob already exists, it gets replaced
641                 with the new data.
642         [/description]
643
644 [subcommand cat`$2']
645         purpose = dump a `$1' blob to stdout
646         non-opts-name = `$1'_name
647         aux_info = AFS_READ
648
649 [subcommand ls`$2']
650         purpose = list blobs of type `$1' which match a pattern
651         non-opts-name = [pattern...]
652         aux_info = AFS_READ
653         [description]
654                 Print the list of all blobs which match the given pattern. If no
655                 pattern is given, the full list is printed.
656         [/description]
657         [option id-sort]
658                 short_opt = i
659                 summary = sort by identifier
660                 [help]
661                         The default is to sort alphabetically by name.
662                 [/help]
663         [option long]
664                 short_opt = l
665                 summary = long listing
666                 [help]
667                         Print identifier and name. The default is to print only the name.
668                 [/help]
669         [option reverse]
670                 short_opt = r
671                 summary = reverse sort order
672 ')
673
674 BLOB_COMMANDS(`moods', `mood')
675 BLOB_COMMANDS(`playlist', `pl')
676 BLOB_COMMANDS(`image', `img')
677 BLOB_COMMANDS(`lyrics', `lyr')