Make the exit status consistent across all programs

(except nfdc)

Change-Id: Ia3edb11b3f4284df5db8279b06e6fb708ae454e9
diff --git a/docs/manpages/ndn-autoconfig-server.rst b/docs/manpages/ndn-autoconfig-server.rst
index 14525e3..d5b14d7 100644
--- a/docs/manpages/ndn-autoconfig-server.rst
+++ b/docs/manpages/ndn-autoconfig-server.rst
@@ -10,7 +10,6 @@
 
     ndn-autoconfig-server [-h] [-p <PREFIX>] [-p <PREFIX>] ... <FACEURI>
 
-
 Description
 -----------
 
@@ -21,9 +20,6 @@
 satisfies them with a Data packet that contains a TLV-encoded FaceUri block.  The value of
 this block is the ``Uri`` for the HUB, preferably a UDP tunnel.
 
-``-h``
-  print usage and exit.
-
 ``<FACEURI>``
   FaceUri for this NDN hub.
 
@@ -34,6 +30,23 @@
   as described in :ref:`local-prefix-discovery`.  If no prefix is specified,
   auto-config-server will not serve any local prefix discovery data.
 
+``-h``
+  Print usage and exit.
+
+``-V``
+  Print version number and exit.
+
+Exit status
+-----------
+
+0: No error.
+
+1: An unspecified error occurred.
+
+2: Malformed command line, e.g., invalid, missing, or unknown argument.
+
+4: Insufficient privileges.
+
 Examples
 --------
 
@@ -43,7 +56,6 @@
 
     ndn-autoconfig-server -p /ndn/edu/ucla tcp://spurs.cs.ucla.edu
 
-
 See also
 --------
 
diff --git a/docs/manpages/ndn-autoconfig.rst b/docs/manpages/ndn-autoconfig.rst
index 4ea69d4..9520bed 100644
--- a/docs/manpages/ndn-autoconfig.rst
+++ b/docs/manpages/ndn-autoconfig.rst
@@ -18,9 +18,6 @@
 Options
 -------
 
-``-h`` or ``--help``
-  Print usage information.
-
 ``-d`` or ``--daemon``
   Run ndn-autoconfig in daemon mode, detecting network change events and re-running
   auto-discovery procedure.  In addition, the auto-discovery procedure is unconditionally
@@ -36,8 +33,11 @@
   Use the specified URL to find the closest hub (NDN-FCH protocol).  If not specified,
   ``http://ndn-fch.named-data.net`` will be used.  Only ``http://`` URLs are supported.
 
+``-h`` or ``--help``
+  Print help message and exit.
+
 ``-V`` or ``--version``
-  Print version information.
+  Show version information and exit.
 
 .. _NDN hub discovery procedure:
 
@@ -179,6 +179,16 @@
   If this query is answered, connect to the home HUB and terminate auto-discovery.
   Otherwise, the auto-discovery fails.
 
+Exit status
+-----------
+
+0: No error.
+
+1: An unspecified error occurred.
+
+2: Malformed command line, e.g., invalid, missing, or unknown argument.
+
+4: Insufficient privileges.
 
 See also
 --------
diff --git a/docs/manpages/nfd-autoreg.rst b/docs/manpages/nfd-autoreg.rst
index d2fb303..33e94bd 100644
--- a/docs/manpages/nfd-autoreg.rst
+++ b/docs/manpages/nfd-autoreg.rst
@@ -1,4 +1,4 @@
-ndn-autoreg
+nfd-autoreg
 ===========
 
 Usage
@@ -11,23 +11,20 @@
 Description
 -----------
 
-``autoreg-server`` is a daemon application that automatically registers the specified
-prefix(es) when new on-demand Faces are created (i.e., when a new UDP face is created as
+``nfd-autoreg`` is a daemon application that automatically registers the specified
+prefix(es) when new on-demand faces are created (i.e., when a new UDP face is created as
 the result of an incoming packet or when a new TCP face is created as the result of an
 incoming connection).
 
 Options
 -------
 
-``-h`` or ``--help``
-  Produce help message.
-
 ``-i`` or ``--prefix``
   Prefix that should be automatically registered when a new remote face is created.
-  Can be repeated multiple to specify additional prefixes.
+  Can be repeated multiple times to specify additional prefixes.
 
 ``-c`` or ``--cost``
-  RIB cost to be assigned to auto-registered prefixes.   if not specified, default cost
+  RIB cost to be assigned to auto-registered prefixes.   If not specified, default cost
   is set to 255.
 
 ``-w`` or ``--whitelist``
@@ -48,10 +45,27 @@
 
   Default: none
 
+``-h`` or ``--help``
+  Print help message and exit.
+
+``-V`` or ``--version``
+  Show version information and exit.
+
+Exit status
+-----------
+
+0: No error.
+
+1: An unspecified error occurred.
+
+2: Malformed command line, e.g., invalid, missing, or unknown argument.
+
+4: Insufficient privileges.
+
 Examples
 --------
 
-Auto-register two prefixes for any newly created on-demand Face, except those that has
+Auto-register two prefixes for any newly created on-demand face, except those that has
 source IP address in ``10.0.0.0/8`` network::
 
     nfd-autoreg --prefix=/app1/video --prefix=/app2/pictures -b 10.0.0.0/8
diff --git a/docs/manpages/nfd.rst b/docs/manpages/nfd.rst
index 0fa0ef8..b87c0f3 100644
--- a/docs/manpages/nfd.rst
+++ b/docs/manpages/nfd.rst
@@ -8,25 +8,37 @@
 
     nfd [options]
 
-
 Description
 -----------
 
 NFD forwarding daemon.
 
+Options
+-------
 
-Options:
---------
-
-``--help``
-  Print this help message.
-
-``--modules``
-  List available logging modules
-
-``--config <path/to/nfd.conf>``
+``-c <path/to/nfd.conf>`` or ``--config <path/to/nfd.conf>``
   Specify the path to nfd configuration file (default: ``${SYSCONFDIR}/ndn/nfd.conf``).
 
+``-m`` or ``--modules``
+  List available logging modules.
+
+``-h`` or ``--help``
+  Print help message and exit.
+
+``-V`` or ``--version``
+  Show version information and exit.
+
+Exit status
+-----------
+
+0: No error.
+
+1: An unspecified error occurred.
+
+2: Malformed command line, e.g., invalid, missing, or unknown argument.
+
+4: Insufficient privileges.
+
 Examples
 --------