Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cleanup of all man pages and how they're loaded

From Tiago Cunha, with much thanks:

   *  Make the manpages description fit on a single line. Therefore,
      removed vitunes (since, it's kind of redundant), from most of
      them. Besides, this seems to fit what mdoc(7) says about the Nd
      macro.
   *  Instead of having things like:
         vitunes -eadd path1 [path2 ...]
      Just make it use:
         vitunes -eadd path [...]
      It's more common, at least, on OpenBSD.
   *  Removed the TagLib website from the manpages. Isn't this type of
      thing more suitable in the DEVELOPERS file (it's already there)?
   *  Deleted the example script from vitunes-addurl.1 and, instead,
      pointed the user to the distributed add-urls.sh file.
   *  Use \& on some of the examples to prevent mandoc from eating the
      double quotes.
   *  Removed the GETTING STARTED pointer in all of vitunes-*.1 files.
      Isn't it enough listing the main manpage in SEE ALSO?
   *  GETTING STARTED is now a section, instead of a sub-section of
      DESCRIPTION.
   *  Sprinkled quite a few macros.
   *  Again, new sentences new line and removed second person.
   *  Added yourself to the authors section.

   I've also changed how the e-commands manpages are invoked. Rather
   than having small functions that spawn a new process, ecmd_help is
   responsible of doing it, now. As a consequence, if a new e-command
   is added, there's no need to create another _help function.
  • Loading branch information...
commit ee39dbe0756e421cccc8d6cd6d2cad4c1d924878 1 parent 1ae9828
@ryanflannery authored
View
2  DEVELOPERS.txt
@@ -209,7 +209,7 @@ CODE STRUCTURE: THE MODULES
e_commands All code for each of the e-commands (vitunes -e CMD ...)
- is here. Used excluviely in vitunes.c.
+ is here. Used exclusively in vitunes.c.
vitunes The "main" program. In normal mode, does setup of media-
View
59 doc/vitunes-add.1
@@ -17,25 +17,34 @@
.Os
.Sh NAME
.Nm vitunes-add
-.Nd add files to the vitunes database
+.Nd add files to the database
.Sh SYNOPSIS
-.Nm vitunes -e add Ar /path/to/music Op Ar /path/to/more/music ...
+.Nm vitunes -e add
+.Bk -words
+.Ar path
+.Op ...
+.Ek
.Sh DESCRIPTION
-The add command is used to add files to the database used by
-.Nm vitunes .
-For every file/directory provided as a parameter,
-.Nm
+The
+.Ic add
+e-command is used to add files to the
+.Nm vitunes
+database.
+For every
+.Ar path
+provided as a parameter,
+.Nm vitunes
will scan that file or directory (recursively) searching for media files
-that contain any meta information. Any such files found are added to
-the database that was created after running
+that contain any meta-information.
+Any such files found are added to the database that was created after running
.Xr vitunes-init 1 .
.Pp
If any files scanned are already in the database they will be re-scanned
-and any changes will be updated. Files that are scanned are not moved,
-copied, or modifieid in any way.
+and any changes will be updated.
+Files that are scanned are not moved, copied, or modifieid in any way.
.Pp
The information
-.Nm
+.Nm vitunes
stores for each file includes:
.Bl -column "Really long string" "Really long string" -offset indent
.It Li "Filename" Ta "Track Number"
@@ -48,29 +57,29 @@ The filename stored is the absolute pathname obtained from
.Xr realpath 3
and serves as the key-field within the database.
.Pp
-All meta data is extracted using
+All meta-data is extracted using
.Xr TagLib 3 .
.Pp
-If any file encountered has no meta information, it is not added to the
+If any file encountered has no meta-information, it is not added to the
database.
.Sh EXAMPLES
To add a single file to the database:
-.Dl $ vitunes -e add /path/to/music.mp3
+.Pp
+.Dl $ vitunes -e add /path/to/music.mp3
.Pp
To search directories recursively and add all files contained:
-.Dl $ vitunes -e add ~/music /usr/local/share/music
+.Pp
+.Dl $ vitunes -e add ~/music /usr/local/share/music
.Sh SEE ALSO
.Xr vitunes 1 ,
.Xr vitunes-init 1 ,
.Xr realpath 3 ,
-.Xr TagLib 3 .
-.Pp
-More information about TagLib can be found on the TagLib website:
-.Lk http://developer.kde.org/~wheeler/taglib.html
-.Pp
-For an overview of how
+.Xr TagLib 3
+.Sh NOTES
.Nm vitunes
-works, see the
-.Sx GETTING STARTED
-section in
-.Xr vitunes 1 .
+only maintains information about the file and not the file itself.
+It does
+.Sy not
+move/copy/modify the files in its database in any way.
+.Sh AUTHORS
+.An Ryan Flannery Aq Mt ryan.flannery@gmail.com .
View
115 doc/vitunes-addurl.1
@@ -17,89 +17,86 @@
.Os
.Sh NAME
.Nm vitunes-addurl
-.Nd add a URL (or other non-file playable item) to the vitunes database
+.Nd add a URL (or non-file playable item) to the database
.Sh SYNOPSIS
-.Nm vitunes -e addurl Ar URL
+.Nm vitunes -e addurl
+.Bk -words
+.Ar URL | path
+.Ek
.Sh DESCRIPTION
To add non-standard files to the
.Xr vitunes 1
database (things like URL's for Internet radio streams), one can use the
-.Nm
-command. It takes a single parameter: the URL/filename to be added to the
-database.
+.Ic addurl
+e-command.
+It takes a single parameter: the
+.Ar URL
+or
+.Ar path
+to be added to the database.
.Pp
Since meta-information can't be extracted automatically for most URL's,
-.Nm
-will prompt you to manually enter all such information (artist, album,
-title, track, year, and genre). You may leave any/all of the fields
-blank.
+it needs to be inputted manually.
+Fields can be left blank, if wanted.
.Pp
Note that anything
.Xr mplayer 1
or
.Xr gstreamer 3
-can play may be added. To test if a URL is playable by
+can play may be added.
+To test if a
+.Ar URL
+is playable by
.Xr mplayer 1 ,
simply try the following, and if it plays, it may be added:
.Dl $ mplayer URL
.Pp
-Although regular files could also be added using this command, the
-.Xr vitunes-add 1
-command is preferred, as it attempts to extract meta information
+Although regular files could also be added using this e-command, the
+.Ic add
+e-command is preferred, as it attempts to extract meta-information
automatically.
.Pp
-Note that files added to the database using the addurl command are NOT
-checked for updates during a
-.Xr vitunes-update 1
-command.
+Note that files added to the database using the
+.Ic addurl
+e-command are
+.Sy not
+checked for updates during an
+.Ic update 1
+e-command.
.Pp
-The addurl command can also be used to change the meta-information of an
-existing URL within the database.
+The
+.Ic addurl
+e-command can also be used to change the meta-information of an
+existing
+.Ar URL
+within the database.
.Sh EXAMPLES
An example of adding an Internet radio stream would look something like
the following:
-.Bd -literal
- $ vitunes -e addurl \"http://198.234.121.118:80\"
- Artist: WVXU Online Radio<ENTER>
- Album: Cincinnati Public Radio<ENTER>
- Title: NPR<ENTER>
- Track: <ENTER>
- Year: <ENTER>
- Genre: Radio<ENTER>
- Length: INF<ENTER>
-.Ed
-.Sh NOTES
-When the
-.Xr vitunes 1
-database has to be re-built (because of say, an upgrade where the
-database format has changed, or you simply deleted your database),
-re-adding URL's can be tedious. To ease this, consider using a shell
-script such as the 'add_urls.sh' script found on the
-.Xr vitunes 1
-website for storing & adding all of your URL's. The script simply
-executes the
-.Nm
-command with all meta-information provided.
.Pp
-As an example, the above could be automated using the following simple
-shell script:
-.Bd -literal
- #!/bin/sh
- echo "WVXU Online Radio Cincinnati Public Radio\\n
- NPR\\n
- \\n
- \\n
- Radio\\n
- INF\\n" | vitunes -e addurl "http://198.234.121.118:80"
+.Dl $ vitunes -e addurl \&"http://198.234.121.118:80"
+.Bd -literal -offset indent
+Artist: WVXU Online Radio<ENTER>
+Album: Cincinnati Public Radio<ENTER>
+Title: NPR<ENTER>
+Track: <ENTER>
+Year: <ENTER>
+Genre: Radio<ENTER>
+Length: INF<ENTER>
.Ed
.Sh SEE ALSO
.Xr vitunes 1 ,
.Xr vitunes-init 1 ,
-.Xr vitunes-add 1 .
-.Pp
-For an overview of how
-.Nm vitunes
-works, see the
-.Sx GETTING STARTED
-section in
-.Xr vitunes 1 .
+.Xr vitunes-add 1
+.Sh NOTES
+When the
+.Xr vitunes 1
+database has to be re-built (because of say, an upgrade where the
+database format has changed or the database was deleted), re-adding
+URL's can be tedious.
+To ease this, consider using a shell script like the
+.Pa add_urls.sh
+file distributed with
+.Nm vitunes .
+.Sh AUTHORS
+.An Ryan Flannery Aq Mt ryan.flannery@gmail.com .
View
44 doc/vitunes-check.1
@@ -20,40 +20,43 @@
.Nd check files for meta-information and if they are in the database
.Sh SYNOPSIS
.Nm vitunes -e check
+.Bk -words
.Op Fl drs
-.Ar file1 Op file2 ...
+.Ar path
+.Op ...
+.Ek
.Sh DESCRIPTION
The
-.Nm
-command will scan each file provided to see to see if any media
+.Ic check
+e-command will scan each file provided to see if any media
meta-information is present in the file, how
.Xr vitunes-add 1
-will sanitize that met-information (see below), or what information
+will sanitize that meta-information (see below), or what information
.Xr vitunes 1
currently has in the database for the file.
.Pp
The options are as follows:
.Bl -tag -width Fl
-.It Fl d Ar file1 Op file2 ...
+.It Fl d
Load the
.Xr vitunes 1
-database and check to see if each file exists within it. If so, show
-the information contained in the database.
-.It Fl r Ar file1 Op file2 ...
+database and check to see if each file exists within it.
+If so, show the information contained in the database.
+.It Fl r
Show the raw information extracted directly from each file.
-.It Fl s Ar file1 Op file2 ...
-Show the sanitized information after extracting it from each file. See
-the section
+.It Fl s
+Show the sanitized information after extracting it from each file.
+See the section
.Sx SANITATION
below for details on what this is.
.El
.Pp
If multiple files are provided, each will be checked in order.
.Sh SANITATION
-Some media files have non-printable characters in their meta information
+Some media files have non-printable characters in their meta-information
for one reason or another (often, it's a faulty ripper/tagging
-application). Sometimes these non-printable characters can be control
-sequences used by
+application).
+Sometimes these non-printable characters can be control sequences used by
.Xr ncurses 3
and thus cause problems with the display of
.Xr vitunes 1 .
@@ -62,15 +65,12 @@ To prevent any such problems,
.Xr vitunes-add 1
sanitizes such data by replacing any problematic characters with '?'.
.Sh EXAMPLES
+To show raw information from a file:
+.Pp
.Dl $ vitunes -e check -r /path/to/file.mp3
.Sh SEE ALSO
.Xr vitunes 1 ,
.Xr vitunes-add 1 ,
-.Xr ncurses 3 .
-.Pp
-For an overview of how
-.Nm vitunes
-works, see the
-.Sx GETTING STARTED
-section in
-.Xr vitunes 1 .
+.Xr ncurses 3
+.Sh AUTHORS
+.An Ryan Flannery Aq Mt ryan.flannery@gmail.com .
View
33 doc/vitunes-flush.1
@@ -17,14 +17,16 @@
.Os
.Sh NAME
.Nm vitunes-flush
-.Nd output the contents of the vitunes database to stdout
+.Nd output the contents of the database to stdout
.Sh SYNOPSIS
.Nm vitunes -e flush
+.Bk -words
.Op Fl t Ar time-format
+.Ek
.Sh DESCRIPTION
The
-.Nm
-command simply outputs the meta-information for all files in the
+.Ic flush
+e-command simply outputs the meta-information for all files in the
.Xr vitunes 1
database to
.Xr stdout 4 ,
@@ -40,28 +42,27 @@ is any string acceptable by
.Pp
The output format is a simple comma-separated-value (CSV) one, where
most fields (any that can contain spaces/commas) are within double
-quotes. The first line contains the field names, and those fields that
-are quoted are also quoted in this header row.
+quotes.
+The first line contains the field names, and those fields that are quoted are
+also quoted in this header row.
.Sh EXAMPLES
To perform a simple dump of the datebase, use:
+.Pp
.Dl $ vitunes -e flush
.Pp
To see which files were last updated this month:
-.Dl $ vitunes -e flush -t "%M %Y" | grep "January 2010"
+.Pp
+.Dl $ vitunes -e flush -t \&"%M %Y" | grep \&"January 2010"
.Sh REFERENCES
For some quick
.Xr sed 1
-one-liners on how to parse CSV data like the output of this command, you
-can visit the following website:
+one-liners on how to parse CSV data like the output of this e-command, visit
+the following website:
+.Pp
.Lk http://sed.sourceforge.net/sedfaq4.html
.Sh SEE ALSO
.Xr vitunes 1 ,
.Xr vitunes-add 1 ,
-.Xr vitunes-update 1 .
-.Pp
-For an overview of how
-.Nm vitunes
-works, see the
-.Sx GETTING STARTED
-section in
-.Xr vitunes 1 .
+.Xr vitunes-update 1
+.Sh AUTHORS
+.An Ryan Flannery Aq Mt ryan.flannery@gmail.com .
View
68 doc/vitunes-init.1
@@ -17,57 +17,49 @@
.Os
.Sh NAME
.Nm vitunes-init
-.Nd initialize the vitunes media database
+.Nd initialize the media database
.Sh SYNOPSIS
+.Bk -words
.Nm vitunes -e init
+.Ek
.Sh DESCRIPTION
-The init command is used to setup the initial files and directories
-used by
+The
+.Ic init
+e-command is used to setup the initial files and directories used by
.Xr vitunes 1 ,
-and must be run once. Running it additional times will have no affect.
-.Pp
-The files created by
-.Nm vitunes-init
-include:
-.Pp
-.Bl -tag -width Ds -compact
-.It Pa ~/.vitunes/
-The root directory where, by default, the
-.Nm
-database and playlists are stored.
-.It Pa ~/.vitunes/vitunes.db
-The library database containing the meta information of all media files
-that
-.Nm
-is aware of.
-.It Pa ~/.vitunes/playlists/
-The directory where every playlist (each a separate file) is stored.
-.El
+and must be run once.
+Running it additional times will have no affect.
.Pp
The database created is initially empty, and files must be added before
.Nm
-can be run normally. See
+can be run normally.
+See
.Xr vitunes-add 1
for instructions on doing this.
.Pp
-This command takes no parameters.
-.Pp
-It is not strictly necessary to run this command to start using
+It is not strictly necessary to run this e-command to start using
.Xr vitunes 1 ,
-as you could use an existing installation, or create the needed files
-and directories yourself. It is provided for convenience.
+since an existing installation could be used or the files created by hand.
+It is provided for convenience.
+.Sh FILES
+.Bl -tag -width Ds -compact
+.It Pa ~/.vitunes
+The
+.Xr vitunes 1
+core directory where everything is stored.
+.It Pa ~/.vitunes/playlists
+The directory where all playlists are stored.
+.It Pa ~/.vitunes/vitunes.db
+The library database containing the meta-information of all media files.
+.El
.Sh EXAMPLES
As the
-.Nm
-command takes no arguments, it's only usage is the following:
+.Ic init
+e-command takes no arguments, it's only usage is the following:
+.Pp
.Dl $ vitunes -e init
.Sh SEE ALSO
.Xr vitunes 1 ,
-.Xr vitunes-add 1 .
-.Pp
-For an overview of how
-.Nm vitunes
-works, see the
-.Sx GETTING STARTED
-section in
-.Xr vitunes 1 .
+.Xr vitunes-add 1
+.Sh AUTHORS
+.An Ryan Flannery Aq Mt ryan.flannery@gmail.com .
View
35 doc/vitunes-rm.1
@@ -17,21 +17,25 @@
.Os
.Sh NAME
.Nm vitunes-rm
-.Nd remove files/URLs from the vitunes database
+.Nd remove a file or a URL from the database
.Sh SYNOPSIS
.Nm vitunes -e rm
+.Bk -words
.Op Fl f
-.Ar file1 Op file2 ...
+.Ar URL | path
+.Ek
.Sh DESCRIPTION
-To remove a single file/URL from the
+To remove a single file
+or
+.Ar URL
+from the
.Xr vitunes 1
database, the
-.Nm
-command may be used. It takes a single parameter: the filename/URL of
-the file to remove.
+.Ic rm
+e-command may be used.
.Pp
-Normally, you will be prompted if you are sure you want to remove the
-file as a safety measure. This prompt can be avoided using the
+Normally, a prompt is shown as a safety measure.
+This prompt can be avoided using the
.Op Fl f
flag, to force the removal.
.Pp
@@ -42,18 +46,15 @@ provided, as obtained from
To remove a single file from the
.Xr vitunes 1
database, use:
+.Pp
.Dl $ vitunes -e rm /path/to/file.mp3
.Pp
To remove a URL, such as that for an Internet radio stream, use:
-.Dl $ vitunes -e rm -f "http://198.234.121.118/listen.pls"
+.Pp
+.Dl $ vitunes -e rm -f \&"http://198.234.121.118/listen.pls"
.Sh SEE ALSO
.Xr vitunes 1 ,
.Xr vitunes-add 1 ,
-.Xr realpath 3 .
-.Pp
-For an overview of how
-.Nm vitunes
-works, see the
-.Sx GETTING STARTED
-section in
-.Xr vitunes 1 .
+.Xr realpath 3
+.Sh AUTHORS
+.An Ryan Flannery Aq Mt ryan.flannery@gmail.com .
View
69 doc/vitunes-tag.1
@@ -20,6 +20,7 @@
.Nd set the meta-information tags in media files
.Sh SYNOPSIS
.Nm vitunes -e tag
+.Bk -words
.Op Fl A Ar album
.Op Fl -album=string
.Op Fl a Ar artist
@@ -34,24 +35,20 @@
.Op Fl -year=number
.Op Fl c Ar comment
.Op Fl -comment=string
-.Ar file1 Op file2 ...
+.Ar path
+.Op ...
+.Ek
.Sh DESCRIPTION
The
-.Nm
-command is provided to add or change the meta-information tags of media
-files. The meta-information fields that can be set are: artist, album,
-title, genre, track, year, and comment.
+.Ic tag
+e-command is provided to add or change the meta-information tags of media
+files.
+The meta-information fields that can be set are: artist, album, title,
+genre, track, year, and comment.
.Pp
-Note that this command only changes the meta-information in the raw files
-themselves and not their values as stored in the
-.Xr vitunes 1
-database. To update the database after tagging, use the
-.Xr vitunes-update 1
-e-command.
-.Pp
-The tag command takes a series of field/value specifiers and any number
-of files. For each file specified, the specified fields will be set to
-the provided value.
+For each
+.Ar path
+specified, the given fields will be set to the provided value.
.Pp
The options are as follows:
.Pp
@@ -70,45 +67,39 @@ Sets the genre field to the provided string.
Sets the title field to the provided string.
.It Fl T Ar track
.It Fl --track=number
-Sets the track field to the provided number. Note that the number must
-be between 0 and INT_MAX.
+Sets the track field to the provided number.
+Note that the number must be between 0 and INT_MAX.
.It Fl y Ar year
.It Fl -year=number
-Sets the year field to the provided number. Note that the number must
-be between 0 and INT_MAX.
+Sets the year field to the provided number.
+Note that the number must be between 0 and INT_MAX.
.It Fl c Ar comment
.It Fl -comment=string
Sets the comment field to the provided string.
.El
-.Pp
-At least one of the above options must be provided and at least one file
-must be specified.
-.Sh NOTE
-Just to reiterate a comment above, this command only changes the meta-
-information in the raw files themselves and not the values in the
+.Sh NOTES
+This e-command only changes the meta-information in the raw files themselves
+and not the values in the
.Xr vitunes 1
-database. To update the vitunes database after tagging, use the
-.Xr vitunes-update 1
+database.
+To update the vitunes database after tagging, use the
+.Ic add
or
-.Xr vitunes-add
+.Ic update
e-commands.
.Sh EXAMPLES
CD rippers frequently pull information from CDDB (or other databases)
where, for example, a "The" is missing from an artist/album name when it
-is, in fact, appropriate. Below is an example of correcting this and
-then updating the
+is, in fact, appropriate.
+Below is an example of correcting this and then updating the
.Xr vitunes 1
database:
-.Dl $ vitunes -e tag --artist=\"The White Stripes\" /path/to/De_Stijl/*
+.Pp
+.Dl $ vitunes -e tag --artist=\&"The White Stripes" /path/to/De_Stijl/*
.Dl $ vitunes -e update
.Sh SEE ALSO
.Xr vitunes 1 ,
.Xr vitunes-add 1 ,
-.Xr vitunes-update 1 .
-.Pp
-For an overview of how
-.Nm vitunes
-works, see the
-.Sx GETTING STARTED
-section in
-.Xr vitunes 1 .
+.Xr vitunes-update 1
+.Sh AUTHORS
+.An Ryan Flannery Aq Mt ryan.flannery@gmail.com .
View
43 doc/vitunes-update.1
@@ -17,29 +17,32 @@
.Os
.Sh NAME
.Nm vitunes-update
-.Nd update all files in the vitunes database
+.Nd update all files in the database
.Sh SYNOPSIS
.Nm vitunes -e update
+.Bk -words
.Op Fl fs
+.Ek
.Sh DESCRIPTION
The
-.Nm
-command loads the existing
+.Ic update
+e-command loads the existing
.Xr vitunes 1
database and for each file listed, the file is checked to see if it has
been removed or modified since it was added to the database or last
-updated. If the file has been removed, it will be removed from the
-database. If the file has been modified, it's meta information will be
-extracted again and the database will be updated.
+updated.
+If the file has been removed, it will be removed from the database.
+If the file has been modified, it's meta-information will be extracted again
+and the database will be updated.
.Pp
Note that if there are errors while checking any file, the error will be
-reported but such files, and their meta information, will remain in the
+reported but such files, and their meta-information, will remain in the
database.
.Pp
The options are as follows:
.Bl -tag -width Fl
.It Fl f
-Force the update of meta information of all files, even if their
+Force the update of meta-information of all files, even if their
modification times haven't changed.
.It Fl s
When present, files that are skipped because they have not been modified
@@ -47,25 +50,25 @@ will also be reported to
.Xr stdout 4 .
Normally, only files that are updated are reported.
.El
-Anytime you remove/modify media files already in the
+Anytime media files are removed/modified which are already in the
.Xr vitunes 1
-database, you should run this command.
+database, the
+.Ic update
+e-command should be used.
.Sh NOTES
Any files/URLs added to the database using the
-.Xr vitunes-addurl 1
-e-command will not be checked/updated in any way, for obvious reasons.
+.Ic addurl
+e-command will
+.Sy not
+be checked/updated in any way, for obvious reasons.
.Sh EXAMPLES
To scan all files in the
.Xr vitunes 1
database for updates, simply use:
+.Pp
.Dl $ vitunes -e update
.Sh SEE ALSO
.Xr vitunes 1 ,
-.Xr vitunes-add 1 .
-.Pp
-For an overview of how
-.Nm vitunes
-works, see the
-.Sx GETTING STARTED
-section in
-.Xr vitunes 1 .
+.Xr vitunes-add 1
+.Sh AUTHORS
+.An Ryan Flannery Aq Mt ryan.flannery@gmail.com .
View
175 doc/vitunes.1
@@ -20,12 +20,14 @@
.Nd A curses media indexer and player for vi-users
.Sh SYNOPSIS
.Nm vitunes
+.Bk -words
.Op Fl c Ar command
.Op Fl d Ar database-file
.Op Fl e Ar command Op argument ...
.Op Fl f Ar config-file
.Op Fl m Ar media-backend
.Op Fl p Ar playlist-dir
+.Ek
.Sh DESCRIPTION
.Nm
is a curses-based music player and playlist manager for *nix whose goals are
@@ -41,28 +43,24 @@ play the media it indexes (via
accepts the following command line options:
.Bl -tag -width Fl
.It Fl c Ar command
-Execute the specified command in the currently running
+Execute the specified
+.Ar commands
+in the currently running
.Nm
instance, and exit.
This is useful for controlling
.Nm
from other windows or scripts.
.Pp
-The commands that may be specified are both those named in the
+The
+.Ar commands
+that may be specified are both those named in the
.Sx RUN-TIME COMMANDS
section below and keybindings specified by their keybinding action name,
listed in the
.Sx KEYBINDING ACTIONS
section below.
.Pp
-To execute multiple commands, use this option repeatedly as
-.Dl $ vitunes -c command1 -c command2 ...
-.Pp
-For example, to have the currently running
-.Nm
-load and play a playlist, one could issue:
-.Dl $ vitunes -c So playlist SomePlaylist Sc -c media_play
-.Pp
Note that for this to work, when
.Nm
starts up it attempts to create a socket at
@@ -70,8 +68,9 @@ starts up it attempts to create a socket at
that are used by this option to communicate with the original instance.
If this socket cannot be created for any reason, this option will not work.
.It Fl d Ar database-file
-Specifies the database containing all known media files and their meta
-information that
+Specifies the
+.Ar database-file
+containing all known media files and their meta-information that
.Nm
should use.
If this option is used in conjunction with an e-command, the option
@@ -80,7 +79,7 @@ be specified before the e-command.
.Pp
The default location is
.Pa ~/.vitunes/vitunes.db .
-.It Fl e Ar command Cm options
+.It Fl e Ar command Ar options
Execute one of the available e-commands to manipulate the database that
.Nm
uses.
@@ -88,7 +87,8 @@ See the section below titled
.Sx E-COMMANDS
for more information.
.It Fl f Ar config-file
-Specifies the path of the configuration file
+Specifies and alternative
+.Ar config-file
.Nm
should load.
See the section below titled
@@ -98,7 +98,9 @@ for information on what the configuration may contain.
The default location is
.Pa ~/.vitunes/vitunes.conf .
.It Fl m Ar media-backend
-Specify the media backend to use for playback.
+Specify the
+.Ar media-backend
+to use for playback.
The current list of supported media backends are:
.Bl -tag -width "mplayer"
.It Cm mplayer
@@ -117,14 +119,17 @@ environment variable.
.It Cm gst
Uses the
.Cm gstreamer
-multimedia library for media playback. Note that the media formats supported
-by this backend depend on what gstreamer plugins are installed.
+multimedia library for media playback.
+Note that the media formats supported by this backend depend on what gstreamer
+plugins are installed.
.El
.Pp
The default backend is
.Cm mplayer .
.It Fl p Ar playlist-dir
-Specifies the directory containing all of the playlists
+Specifies an alternative
+.Ar playlist-dir
+containing all of the playlists
.Nm
will load and use.
Any new playlists created while running
@@ -134,7 +139,7 @@ will be created here.
The default location is
.Pa ~/.vitunes/playlists/ .
.El
-.Ss Getting Started
+.Sh GETTING STARTED
.Nm
works by maintaining a database of tagged media files.
The database
@@ -227,65 +232,9 @@ See the
.Sx KEYBINDING ACTIONS
section for a complete listing.
.Sh E-COMMANDS
-Below is a brief summary of each e-command available in
-.Nm .
-More detailed usage information and examples for each can be obtained by
-issuing:
+More detailed usage information and examples for each e-command can be
+obtained by issuing:
.Dl $ vitunes -e help command-name
-.Bl -tag -width Ds
-.It Nm Fl e Cm init
-Create the necessary database file and playlist directory used by
-.Nm .
-This command only needs to be run once, when
-.Nm
-is first run.
-If either of these already exist, they remain unchanged.
-.It Nm Fl e Cm add Ar path1 Op Ar path2 ...
-This command takes any number of files/directories as parameters.
-Each file is scanned for meta-information and if found, added to the
-database.
-Directories are search recursively.
-.Pp
-.Xr TagLib 3
-is used for all meta-extraction, which includes the following fields:
-album, artist, comment, play-length, title, track number, and year.
-.It Nm Fl e Cm addurl Ar url
-This command is used to add non-files (things like URL's for Internet radio
-stations) to the database, where the meta-information cannot be determined
-automatically.
-It can also be used to update the meta-info of an existing URL in the
-database.
-.Pp
-After executing, all meta-information needs to be inputted manually.
-.It Nm Fl e Cm check Oo Fl rsd Oc Ar file1 Op Ar file2 ...
-Scan the files specified and display their meta-information as present in
-the files themselves or in the
-.Nm
-database.
-This is useful for checking if a file is in the database.
-.It Nm Fl e Cm flush Op Fl t Ar time-format
-Dump the contents of the database to stdout in an easy-to-parse format,
-optionally with the specified
-.Xr strftime 3
-compatible format for times.
-.It Nm Fl e Cm help Ar command
-Display detailed usage information and examples for the e-command specified
-by
-.Ar command .
-.It Nm Fl e Cm rm Oo Fl f Oc Ar file/url
-Remove a file/URL from the database.
-.It Nm Fl e Cm rmfile Oo Fl f Oc Ar file/url
-Alias for the "rm" e-command.
-.It Nm Fl e Cm tag Oo options Oc Ar file1 Op Ar file2 ...
-Add/modify the meta-information tags of raw files.
-There are many options to this e-command.
-See the help page for more information:
-.Dl $ vitunes -e help tag
-.It Nm Fl e Cm update Op Fl s
-Load the existing database and check each file to see if its meta-information
-has been updated, or if the file has been removed.
-The database is updated accordingly.
-.El
.Sh RUN-TIME COMMANDS
Below is a listing of all run-time commands supported by
.Nm .
@@ -706,12 +655,12 @@ are:
Some examples of using keycodes and the
.Pf : Ic bind
run-time command are:
-.Bd -literal
- bind paste_after p
- bind paste_before P
+.Bd -literal -offset indent
+bind paste_after p
+bind paste_before P
- bind scroll_up_halfpage Control u
- bind scroll_down_halfpage Control d
+bind scroll_up_halfpage Control u
+bind scroll_down_halfpage Control d
.Ed
.Sh KEYBINDING ACTIONS
The current list of available actions that keys may be bound to is the
@@ -1011,12 +960,12 @@ DEFAULT BINDINGS:
.Pp
Some examples of using the above actions and keycodes to define the default
keybdings are:
-.Bd -literal
- bind paste_after p
- bind paste_before P
+.Bd -literal -offset indent
+bind paste_after p
+bind paste_before P
- bind scroll_up_halfpage Control u
- bind scroll_down_halfpage Control d
+bind scroll_up_halfpage Control u
+bind scroll_down_halfpage Control d
.Ed
.Sh CONFIGURATION FILE
The configuration file loaded by
@@ -1040,32 +989,28 @@ As such, review the list of commands above.
.Pp
An example configuration file that would setup some hideous DOS-like colors
is:
-.Bd -literal
- # setup colors
- color bars=white,blue
- color player=yellow,blue
- color library=green,blue
- color playlist=white,blue
- color status=red,blue
+.Bd -literal -offset indent
+# setup colors
+color bars=white,blue
+color player=yellow,blue
+color library=green,blue
+color playlist=white,blue
+color status=red,blue
- # format for playlist window
- display artist.20,album.20,title.20,track.4,year.4
+# format for playlist window
+display artist.20,album.20,title.20,track.4,year.4
- # show most recent work of an artist first in library window
- sort artist,-year
+# show most recent work of an artist first in library window
+sort artist,-year
- # make library window 20 columns wide and hide when not active
- set lwidth=20
- set lhide=true
+# make library window 20 columns wide and hide when not active
+set lwidth=20
+set lhide=true
.Ed
.Sh FILES
.Bl -tag -width Ds -compact
.It Pa ~/.vitunes/vitunes.conf
Default configuration file.
-.It Pa ~/.vitunes/vitunes.db
-Default database file.
-.It Pa ~/.vitunes/playlists/
-Default playlist directory.
.It Pa /tmp/.vitunes
Default location for the socket created on start-up that can be used to control
.Nm .
@@ -1074,14 +1019,24 @@ Default path to the
.Xr mplayer 1
binary.
.El
+.Sh EXAMPLES
+To have the currently running
+.Nm
+load and play a playlist:
+.Pp
+.Dl $ vitunes -c So playlist SomePlaylist Sc -c media_play
.Sh SEE ALSO
.Xr mplayer 1 ,
-.Xr realpath 3 ,
.Xr strftime 3 ,
-.Xr vi 1 .
-.Pp
-More information about TagLib can be found on the TagLib website:
-.Lk http://developer.kde.org/~wheeler/taglib.html
+.Xr vi 1 ,
+.Xr vitunes-add 1 ,
+.Xr vitunes-addurl 1 ,
+.Xr vitunes-check 1 ,
+.Xr vitunes-flush 1 ,
+.Xr vitunes-init 1 ,
+.Xr vitunes-rm 1 ,
+.Xr vitunes-tag 1 ,
+.Xr vitunes-update 1
.Pp
The
.Nm
View
97 e_commands.c
@@ -17,16 +17,16 @@
#include "e_commands.h"
const struct ecmd ECMD_PATH[] = {
- { "init", ecmd_init, ecmd_help_init},
- { "add", ecmd_add, ecmd_help_add },
- { "addurl", ecmd_addurl, ecmd_help_addurl },
- { "check", ecmd_check, ecmd_help_check },
- { "rmfile", ecmd_rmfile, ecmd_help_rmfile },
- { "rm", ecmd_rmfile, ecmd_help_rmfile },
- { "update", ecmd_update, ecmd_help_update },
- { "flush", ecmd_flush, ecmd_help_flush },
- { "tag", ecmd_tag, ecmd_help_tag },
- { "help", ecmd_help, NULL }
+ { "init", ecmd_init },
+ { "add", ecmd_add },
+ { "addurl", ecmd_addurl },
+ { "check", ecmd_check },
+ { "rmfile", ecmd_rmfile },
+ { "rm", ecmd_rmfile },
+ { "update", ecmd_update },
+ { "flush", ecmd_flush },
+ { "tag", ecmd_tag },
+ { "help", ecmd_help }
};
const int ECMD_PATH_SIZE = (sizeof(ECMD_PATH) / sizeof(struct ecmd));
@@ -498,61 +498,12 @@ ecmd_tag(int argc, char *argv[])
return 0;
}
-void
-ecmd_help_init(void)
-{
- system("man vitunes-init");
-}
-
-void
-ecmd_help_add(void)
-{
- system("man vitunes-add");
-}
-
-void
-ecmd_help_addurl(void)
-{
- system("man vitunes-addurl");
-}
-
-void
-ecmd_help_check(void)
-{
- system("man vitunes-check");
-}
-
-void
-ecmd_help_rmfile(void)
-{
- system("man vitunes-rm");
-}
-
-void
-ecmd_help_update(void)
-{
- system("man vitunes-update");
-}
-
-void
-ecmd_help_flush(void)
-{
- system("man vitunes-flush");
-}
-
-void
-ecmd_help_tag(void)
-{
- system("man vitunes-tag");
-}
-
int
ecmd_help(int argc, char *argv[])
{
- bool found;
- int i;
+ char *man_args[3];
- if (argc > 2)
+ if (argc != 2)
errx(1, "usage: -e %s [command]", argv[0]);
/* no help requested for a specific command, give a list of all e-cmds */
@@ -581,21 +532,19 @@ The list of available commands are:\n\n\
}
/* if reach here, help fora specific command was requested */
- found = false;
- for (i = 0; i < ECMD_PATH_SIZE && !found; i++) {
- if (strcmp(argv[1], "help") == 0) {
- printf("You're a damn fool if you need help with help.\n");
- found = true;
- }
- else if (strcmp(argv[1], ECMD_PATH[i].name) == 0) {
- (ECMD_PATH[i].help)();
- found = true;
- }
+ if (strcmp(argv[1], "help") == 0) {
+ printf("You're a damn fool if you need help with help.\n");
+ return 0;
}
- if (!found)
- printf("Unknown command \"%s\". See \"vitunes -e help\" for list.\n", argv[1]);
+ man_args[0] = "man";
+ if (asprintf(&man_args[1], "vitunes-%s", argv[1]) == -1)
+ err(1, "ecmd_help: asprintf failed");
+ man_args[2] = NULL;
+ execvp("man", man_args);
+ err(1, "ecmd_help: execvp failed");
+
+ /* just to shut up gcc */
return 0;
}
-
View
1  e_commands.h
@@ -60,7 +60,6 @@ void ecmd_help_tag(void);
struct ecmd {
char *name;
int (*func)(int argc, char *argv[]);
- void (*help)(void);
};
extern const struct ecmd ECMD_PATH[];
Please sign in to comment.
Something went wrong with that request. Please try again.