Skip to content

Commit

Permalink
cleanup/improve usage and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
falconindy committed Apr 24, 2012
1 parent c70aa78 commit 88b6976
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
34 changes: 28 additions & 6 deletions README.pod
Expand Up @@ -13,21 +13,25 @@ flexibility and aims to be used as a simple tool for other pacman based
utilities which don't link against the library. It uses pacman.conf as a config utilities which don't link against the library. It uses pacman.conf as a config
file for locating and loading your local and sync databases. file for locating and loading your local and sync databases.


Targets are provided on the command line, and can be specified by simple name, Invoking expac consists of supplying a format string, which is generally
or in repo/pkg format if the --sync option is used. described by one to many of the formatting tokens (see the B<FORMATTING>
section), any relevant options and zero to many targets. The format string
B<must> be the first non-option argument. Targets can be a simple package name,
a query string (in the case of a search), or in repo/package syntax when the
-sync option is supplied.


=head1 OPTIONS =head1 OPTIONS


=over 4 =over 4


=item B<-S, --sync>

Search the sync databases for provided targets.

=item B<-Q, --query> =item B<-Q, --query>


Search the local database for provided targets. This is the default behavior. Search the local database for provided targets. This is the default behavior.


=item B<-S, --sync>

Search the sync databases for provided targets.

=item B<-s, --search> =item B<-s, --search>


Search for packages matching the strings specified by targets. This is a Search for packages matching the strings specified by targets. This is a
Expand Down Expand Up @@ -152,6 +156,24 @@ output.


Standard backslash escape sequences are supported, as per printf(1). Standard backslash escape sequences are supported, as per printf(1).


=head1 EXAMPLES

Emulate pacman's search function:

=over 4

$ expac -Ss '%r/%n %v\n %d' <search terms>

=back

List the oldest 10 installed packages (by build date):

=over 4

$ expac --timefmt=%s '%b\t%n' | sort -n | head -10

=back

=head1 AUTHOR =head1 AUTHOR


Dave Reisner E<lt>d@falconindy.comE<gt> Dave Reisner E<lt>d@falconindy.comE<gt>
Expand Down
3 changes: 2 additions & 1 deletion expac.c
Expand Up @@ -217,7 +217,8 @@ static void usage(void) {
" -p, --file query local files instead of the DB\n" " -p, --file query local files instead of the DB\n"
" -t, --timefmt <fmt> date format passed to strftime (default: \"%%c\")\n\n" " -t, --timefmt <fmt> date format passed to strftime (default: \"%%c\")\n\n"
" -v, --verbose be more verbose\n\n" " -v, --verbose be more verbose\n\n"
" -h, --help display this help and exit\n\n"); " -h, --help display this help and exit\n\n"
"For more details see expac(1).\n");
} }


static int parse_options(int argc, char *argv[], alpm_handle_t *handle) { static int parse_options(int argc, char *argv[], alpm_handle_t *handle) {
Expand Down

0 comments on commit 88b6976

Please sign in to comment.