Code

Added sysdb(1) manpage and updated sysdb help output.
authorSebastian Harl <sh@tokkee.org>
Thu, 10 Apr 2014 13:45:37 +0000 (15:45 +0200)
committerSebastian Harl <sh@tokkee.org>
Thu, 10 Apr 2014 13:45:37 +0000 (15:45 +0200)
.gitignore
doc/Makefile.am
doc/sysdb.1.txt [new file with mode: 0644]
src/tools/sysdb/main.c

index f097f95edab772a39db674201301578f8e708b9a..9f1fd8ff4e3ca14646e8733b29d48b78738fa7d2 100644 (file)
@@ -29,6 +29,8 @@ libtool
 ltmain.sh
 
 # build output
+doc/*.1
+doc/*.5
 src/frontend/grammar.c
 src/frontend/grammar.h
 src/frontend/scanner.c
@@ -44,8 +46,6 @@ src/sysdbd
 *.la
 *.lo
 *.o
-sysdbd.1
-sysdbd.conf.5
 sysdb.h
 
 # unit testing output
index a89ea25268609bb04aeca53c8e8e7f20603b5519..76d488fb455960035131a9539c70063c40d12a17 100644 (file)
@@ -1,29 +1,32 @@
 SUFFIXES = .1 .5 .1.txt .5.txt
 
 EXTRA_DIST = \
+               sysdb.1.txt \
                sysdbd.1.txt \
                sysdbd.conf.5.txt
 CLEANFILES = \
+               sysdb.1 \
                sysdbd.1 \
                sysdbd.conf.5
 
 man_MANS = \
+               sysdb.1 \
                sysdbd.1 \
                sysdbd.conf.5
 
+ADOC_ATTRS = -apackage_version=$(PACKAGE_VERSION) \
+               -abuild_date="$$( date --utc '+%F' )" \
+               -alocalstatedir=$(localstatedir)
+
+sysdb.1: sysdb.1.txt ../version
+
 sysdbd.1: sysdbd.1.txt ../version
 
 sysdbd.conf.5: sysdbd.conf.5.txt ../version
 
 .1.txt.1:
-       @A2X@ -d manpage -f manpage \
-               -apackage_version=$(PACKAGE_VERSION) \
-               -abuild_date="$$( date --utc '+%F' )" \
-               $<
+       @A2X@ -d manpage -f manpage $(ADOC_ATTRS) $<
 
 .5.txt.5:
-       @A2X@ -d manpage -f manpage \
-               -apackage_version=$(PACKAGE_VERSION) \
-               -abuild_date="$$( date --utc '+%F' )" \
-               $<
+       @A2X@ -d manpage -f manpage $(ADOC_ATTRS) $<
 
diff --git a/doc/sysdb.1.txt b/doc/sysdb.1.txt
new file mode 100644 (file)
index 0000000..f2838eb
--- /dev/null
@@ -0,0 +1,70 @@
+sysdb(1)
+========
+Sebastian "tokkee" Harl <sh@tokkee.org>
+version {package_version}, {build_date}
+:doctype: manpage
+
+NAME
+----
+sysdb - interactive client for the system management and inventory collection
+service
+
+SYNOPSIS
+--------
+*sysdb* ['options']
+
+DESCRIPTION
+-----------
+*sysdb* is a terminal-based, interactive client program for SysDB, a
+multi-backend system management and inventory collection daemon. It connects
+to a running daemon and then accepts commands from the user, send them to the
+server, and display the result.
+
+OPTIONS
+-------
+*sysdb* accepts the following command-line options.
+
+*-H* '<host>'::
+       The SysDB host to connect to. May be specified as the path to a UNIX
+       socket opened by the daemon. Defaults to {localstatedir}/run/sysdbd.sock.
+
+*-U* '<username>'::
+       The username used to authenticate against the server. Defaults to the
+       current user.
+
+*-h*::
+       Display a usage and help summary and exit.
+
+*-V*::
+       Display the version number and copyright information.
+
+EXIT CODES
+----------
+*0*::
+       Success.
+
+*1*::
+       Failure (syntax or usage error).
+
+BUGS
+----
+None known.
+
+SEE ALSO
+--------
+*sysdbd*(1)
+
+AUTHOR
+------
+sysdbd was written by Sebastian "tokkee" Harl <sh@tokkee.org>.
+
+COPYRIGHT
+---------
+Copyright (C) 2012-2014 Sebastian "tokkee" Harl <sh@tokkee.org>
+
+This is free software under the terms of the BSD license, see the source for
+copying conditions. There is NO WARRANTY; not even for MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.
+
+// vim: set tw=78 sw=4 ts=4 noexpandtab spell spelllang=en_us :
+
index 33f96c4461c24cbea9dd17b5b8c0c611fc428fa9..b20e0ca4d65e3f0de245e358459402de54c77bb0 100644 (file)
 #      define DEFAULT_SOCKET "unix:"LOCALSTATEDIR"/run/sysdbd.sock"
 #endif
 
-static void
-exit_usage(char *name, int status)
-{
-       printf(
-"Usage: %s <options>\n"
-
-"\nOptions:\n"
-"  -h        display this help and exit\n"
-"  -V        display the version number and copyright\n"
-
-"\nSysDB client "SDB_CLIENT_VERSION_STRING SDB_CLIENT_VERSION_EXTRA", "
-PACKAGE_URL"\n", basename(name));
-       exit(status);
-} /* exit_usage */
-
-static void
-exit_version(void)
-{
-       printf("SysDB version "SDB_CLIENT_VERSION_STRING
-                       SDB_CLIENT_VERSION_EXTRA", built "BUILD_DATE"\n"
-                       "using libsysdbclient version %s%s\n"
-                       "Copyright (C) 2012-2014 "PACKAGE_MAINTAINER"\n"
-
-                       "\nThis is free software under the terms of the BSD license, see "
-                       "the source for\ncopying conditions. There is NO WARRANTY; not "
-                       "even for MERCHANTABILITY or\nFITNESS FOR A PARTICULAR "
-                       "PURPOSE.\n", sdb_client_version_string(),
-                       sdb_client_version_extra());
-       exit(0);
-} /* exit_version */
-
 static const char *
 get_current_user(void)
 {
@@ -162,6 +131,42 @@ get_homedir(const char *username)
        return result->pw_dir;
 } /* get_homedir */
 
+static void
+exit_usage(char *name, int status)
+{
+       printf(
+"Usage: %s <options>\n"
+
+"\nOptions:\n"
+"  -H HOST   the host to connect to\n"
+"            default: "DEFAULT_SOCKET"\n"
+"  -U USER   the username to connect as\n"
+"            default: %s\n"
+"\n"
+"  -h        display this help and exit\n"
+"  -V        display the version number and copyright\n"
+
+"\nSysDB client "SDB_CLIENT_VERSION_STRING SDB_CLIENT_VERSION_EXTRA", "
+PACKAGE_URL"\n", basename(name), get_current_user());
+       exit(status);
+} /* exit_usage */
+
+static void
+exit_version(void)
+{
+       printf("SysDB version "SDB_CLIENT_VERSION_STRING
+                       SDB_CLIENT_VERSION_EXTRA", built "BUILD_DATE"\n"
+                       "using libsysdbclient version %s%s\n"
+                       "Copyright (C) 2012-2014 "PACKAGE_MAINTAINER"\n"
+
+                       "\nThis is free software under the terms of the BSD license, see "
+                       "the source for\ncopying conditions. There is NO WARRANTY; not "
+                       "even for MERCHANTABILITY or\nFITNESS FOR A PARTICULAR "
+                       "PURPOSE.\n", sdb_client_version_string(),
+                       sdb_client_version_extra());
+       exit(0);
+} /* exit_version */
+
 int
 main(int argc, char **argv)
 {