diff --git a/src/plugins/nat/det44/det44_cli.c b/src/plugins/nat/det44/det44_cli.c
index 28569c7..5bd81d3 100644
--- a/src/plugins/nat/det44/det44_cli.c
+++ b/src/plugins/nat/det44/det44_cli.c
@@ -18,6 +18,8 @@
  */
 #include <nat/det44/det44.h>
 
+#define DET44_EXPECTED_ARGUMENT "expected required argument(s)"
+
 static clib_error_t *
 det44_map_command_fn (vlib_main_t * vm, unformat_input_t * input,
 		      vlib_cli_command_t * cmd)
@@ -29,7 +31,7 @@
   clib_error_t *error = 0;
 
   if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+    return clib_error_return (0, DET44_EXPECTED_ARGUMENT);
 
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
@@ -74,7 +76,6 @@
   det44_main_t *dm = &det44_main;
   snat_det_map_t *mp;
   vlib_cli_output (vm, "NAT44 deterministic mappings:");
-  /* *INDENT-OFF* */
   pool_foreach (mp, dm->det_maps)
    {
     vlib_cli_output (vm, " in %U/%d out %U/%d\n",
@@ -86,7 +87,6 @@
                      mp->ports_per_host);
     vlib_cli_output (vm, "  sessions number: %d\n", mp->ses_num);
   }
-  /* *INDENT-ON* */
   return 0;
 }
 
@@ -101,7 +101,7 @@
   clib_error_t *error = 0;
 
   if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+    return clib_error_return (0, DET44_EXPECTED_ARGUMENT);
 
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
@@ -142,7 +142,7 @@
   u32 out_port;
 
   if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+    return clib_error_return (0, DET44_EXPECTED_ARGUMENT);
 
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
@@ -187,7 +187,6 @@
   snat_det_session_t *ses;
   snat_det_map_t *mp;
   vlib_cli_output (vm, "NAT44 deterministic sessions:");
-  /* *INDENT-OFF* */
   pool_foreach (mp, dm->det_maps)
    {
     int i;
@@ -198,7 +197,6 @@
           vlib_cli_output (vm, "  %U", format_det_map_ses, mp, ses, &i);
       }
   }
-  /* *INDENT-ON* */
   return 0;
 }
 
@@ -216,7 +214,7 @@
   clib_error_t *error = 0;
 
   if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+    return clib_error_return (0, DET44_EXPECTED_ARGUMENT);
 
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
@@ -269,7 +267,7 @@
   clib_error_t *error = 0;
 
   if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+    return clib_error_return (0, DET44_EXPECTED_ARGUMENT);
 
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
@@ -319,7 +317,7 @@
   u8 reset = 0;
 
   if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+    return clib_error_return (0, DET44_EXPECTED_ARGUMENT);
 
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
@@ -380,7 +378,7 @@
   det44_config_t c = { 0 };
 
   if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+    return clib_error_return (0, DET44_EXPECTED_ARGUMENT);
 
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
@@ -432,7 +430,7 @@
   u8 is_del = 0;
 
   if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+    return clib_error_return (0, DET44_EXPECTED_ARGUMENT);
 
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
@@ -458,7 +456,6 @@
 	}
     }
 
-  /* *INDENT-OFF* */
   vec_foreach (p, sw_if_indices)
     {
       if (det44_interface_add_del (p->sw_if_index, p->is_inside, is_del))
@@ -471,7 +468,6 @@
           break;
         }
     }
-  /* *INDENT-ON* */
 done:
   unformat_free (line_input);
   vec_free (sw_if_indices);
@@ -486,7 +482,6 @@
   det44_main_t *dm = &det44_main;
   det44_interface_t *i;
   vlib_cli_output (vm, "DET44 interfaces:");
-  /* *INDENT-OFF* */
   pool_foreach (i, dm->interfaces)
    {
     vlib_cli_output (vm, " %U %s", format_vnet_sw_if_index_name, vnm,
@@ -495,11 +490,9 @@
                       det44_interface_is_outside(i)) ? "in out" :
                      (det44_interface_is_inside(i) ? "in" : "out"));
   }
-  /* *INDENT-ON* */
   return 0;
 }
 
-/* *INDENT-OFF* */
 /*?
  * @cliexpar
  * @cliexstart{det44 add}
@@ -693,7 +686,6 @@
   .short_help = "show det44 interfaces",
   .function = det44_show_interfaces_command_fn,
 };
-/* *INDENT-ON* */
 
 /*
  * fd.io coding-style-patch-verification: ON
diff --git a/src/plugins/nat/dslite/dslite_cli.c b/src/plugins/nat/dslite/dslite_cli.c
index 0537957..193cb3f 100644
--- a/src/plugins/nat/dslite/dslite_cli.c
+++ b/src/plugins/nat/dslite/dslite_cli.c
@@ -14,6 +14,8 @@
  */
 #include <nat/dslite/dslite.h>
 
+#define DSLITE_EXPECTED_ARGUMENT "expected required argument(s)"
+
 static clib_error_t *
 dslite_add_del_pool_addr_command_fn (vlib_main_t * vm,
 				     unformat_input_t * input,
@@ -29,7 +31,7 @@
 
   /* Get a line of input. */
   if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+    return clib_error_return (0, DSLITE_EXPECTED_ARGUMENT);
 
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
@@ -115,7 +117,7 @@
 
   /* Get a line of input. */
   if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+    return clib_error_return (0, DSLITE_EXPECTED_ARGUMENT);
 
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
@@ -166,7 +168,7 @@
 
   /* Get a line of input. */
   if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+    return clib_error_return (0, DSLITE_EXPECTED_ARGUMENT);
 
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
diff --git a/src/plugins/nat/nat64/nat64_cli.c b/src/plugins/nat/nat64/nat64_cli.c
index a7dd9ab..3af715c 100644
--- a/src/plugins/nat/nat64/nat64_cli.c
+++ b/src/plugins/nat/nat64/nat64_cli.c
@@ -16,6 +16,8 @@
 #include <vnet/fib/fib_table.h>
 #include <nat/nat64/nat64.h>
 
+#define NAT64_EXPECTED_ARGUMENT "expected required argument(s)"
+
 static clib_error_t *
 nat64_plugin_enable_disable_command_fn (vlib_main_t * vm,
 					unformat_input_t * input,
@@ -27,7 +29,7 @@
   nat64_config_t c = { 0 };
 
   if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+    return clib_error_return (0, NAT64_EXPECTED_ARGUMENT);
 
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
@@ -79,7 +81,7 @@
 
   /* Get a line of input. */
   if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+    return clib_error_return (0, NAT64_EXPECTED_ARGUMENT);
 
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
@@ -193,7 +195,7 @@
 
   /* Get a line of input. */
   if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+    return clib_error_return (0, NAT64_EXPECTED_ARGUMENT);
 
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
@@ -335,7 +337,7 @@
   int rv;
 
   if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+    return clib_error_return (0, NAT64_EXPECTED_ARGUMENT);
 
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
@@ -462,7 +464,7 @@
   nat64_db_t *db;
 
   if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+    return clib_error_return (0, NAT64_EXPECTED_ARGUMENT);
 
   if (unformat (line_input, "%U", unformat_nat_protocol, &proto))
     p = nat_proto_to_ip_proto (proto);
@@ -565,7 +567,7 @@
   };
 
   if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+    return clib_error_return (0, NAT64_EXPECTED_ARGUMENT);
 
   if (unformat (line_input, "%U", unformat_nat_protocol, &proto))
     p = nat_proto_to_ip_proto (proto);
@@ -613,7 +615,7 @@
   int rv;
 
   if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+    return clib_error_return (0, NAT64_EXPECTED_ARGUMENT);
 
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
@@ -737,7 +739,7 @@
 
   /* Get a line of input. */
   if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+    return clib_error_return (0, NAT64_EXPECTED_ARGUMENT);
 
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
diff --git a/src/plugins/nat/nat66/nat66_cli.c b/src/plugins/nat/nat66/nat66_cli.c
index 4ba46cb..0ca4087 100644
--- a/src/plugins/nat/nat66/nat66_cli.c
+++ b/src/plugins/nat/nat66/nat66_cli.c
@@ -20,30 +20,45 @@
 #include <nat/nat66/nat66.h>
 #include <vnet/fib/fib_table.h>
 
+#define NAT66_EXPECTED_ARGUMENT "expected required argument(s)"
+#define NAT66_PLUGIN_DISABLED	"error plugin disabled"
+
+#define CHECK_ENABLED()                                                       \
+  do                                                                          \
+    {                                                                         \
+      if (PREDICT_FALSE (!nat66_main.enabled))                                \
+	{                                                                     \
+	  return clib_error_return (0, NAT66_PLUGIN_DISABLED);                \
+	}                                                                     \
+    }                                                                         \
+  while (0)
+
 static clib_error_t *
-nat66_enable_command_fn (vlib_main_t *vm, unformat_input_t *input,
-			 vlib_cli_command_t *cmd)
+nat66_enable_disable_command_fn (vlib_main_t *vm, unformat_input_t *input,
+				 vlib_cli_command_t *cmd)
 {
   nat66_main_t *nm = &nat66_main;
   unformat_input_t _line_input, *line_input = &_line_input;
   clib_error_t *error = 0;
+
   u32 outside_vrf = 0;
+  u8 enable_set = 0, enable = 0;
 
-  if (nm->enabled)
-    return clib_error_return (0, "nat66 already enabled");
-
-  /* Get a line of input. */
   if (!unformat_user (input, unformat_line_input, line_input))
-    {
-      if (nat66_plugin_enable (outside_vrf) != 0)
-	return clib_error_return (0, "nat66 enable failed");
-      return 0;
-    }
+    return clib_error_return (0, NAT66_EXPECTED_ARGUMENT);
 
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
       if (unformat (line_input, "outside-vrf %u", &outside_vrf))
 	;
+      else if (!enable_set)
+	{
+	  enable_set = 1;
+	  if (unformat (line_input, "disable"))
+	    ;
+	  else if (unformat (line_input, "enable"))
+	    enable = 1;
+	}
       else
 	{
 	  error = clib_error_return (0, "unknown input '%U'",
@@ -52,37 +67,47 @@
 	}
     }
 
-  if (nat66_plugin_enable (outside_vrf) != 0)
-    error = clib_error_return (0, "nat66 enable failed");
+  if (!enable_set)
+    {
+      error = clib_error_return (0, "expected enable | disable");
+      goto done;
+    }
+
+  if (enable)
+    {
+      if (nm->enabled)
+	{
+	  error = clib_error_return (0, "already enabled");
+	  goto done;
+	}
+
+      if (nat66_plugin_enable (outside_vrf) != 0)
+	error = clib_error_return (0, "enable failed");
+    }
+  else
+    {
+      if (!nm->enabled)
+	{
+	  error = clib_error_return (0, "already disabled");
+	  goto done;
+	}
+
+      if (nat66_plugin_disable () != 0)
+	error = clib_error_return (0, "disable failed");
+    }
+
 done:
   unformat_free (line_input);
   return error;
 }
 
 static clib_error_t *
-nat66_disable_command_fn (vlib_main_t *vm, unformat_input_t *input,
-			  vlib_cli_command_t *cmd)
-{
-  nat66_main_t *nm = &nat66_main;
-  clib_error_t *error = 0;
-
-  if (!nm->enabled)
-    return clib_error_return (0, "nat66 already disabled");
-
-  if (nat66_plugin_disable () != 0)
-    error = clib_error_return (0, "nat66 disable failed");
-
-  return error;
-}
-
-static clib_error_t *
 nat66_interface_feature_command_fn (vlib_main_t * vm,
 				    unformat_input_t * input,
 				    vlib_cli_command_t * cmd)
 {
   unformat_input_t _line_input, *line_input = &_line_input;
   vnet_main_t *vnm = vnet_get_main ();
-  nat66_main_t *nm = &nat66_main;
   clib_error_t *error = 0;
   u32 sw_if_index;
   u32 *inside_sw_if_indices = 0;
@@ -90,12 +115,10 @@
   u8 is_add = 1;
   int i, rv;
 
-  if (!nm->enabled)
-    return clib_error_return (0, "nat66 disabled");
+  CHECK_ENABLED ();
 
-  /* Get a line of input. */
   if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+    return clib_error_return (0, NAT66_EXPECTED_ARGUMENT);
 
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
@@ -208,9 +231,7 @@
 nat66_show_interfaces_command_fn (vlib_main_t * vm, unformat_input_t * input,
 				  vlib_cli_command_t * cmd)
 {
-  nat66_main_t *nm = &nat66_main;
-  if (!nm->enabled)
-    return clib_error_return (0, "nat66 disabled");
+  CHECK_ENABLED ();
   vlib_cli_output (vm, "NAT66 interfaces:");
   nat66_interfaces_walk (nat66_cli_interface_walk, vm);
   return 0;
@@ -221,20 +242,17 @@
 					 unformat_input_t * input,
 					 vlib_cli_command_t * cmd)
 {
-  nat66_main_t *nm = &nat66_main;
   unformat_input_t _line_input, *line_input = &_line_input;
   clib_error_t *error = 0;
-  u8 is_add = 1;
   ip6_address_t l_addr, e_addr;
   u32 vrf_id = 0;
+  u8 is_add = 1;
   int rv;
 
-  if (!nm->enabled)
-    return clib_error_return (0, "nat66 disabled");
+  CHECK_ENABLED ();
 
-  /* Get a line of input. */
   if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+    return clib_error_return (0, NAT66_EXPECTED_ARGUMENT);
 
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
@@ -302,9 +320,7 @@
 				       unformat_input_t * input,
 				       vlib_cli_command_t * cmd)
 {
-  nat66_main_t *nm = &nat66_main;
-  if (!nm->enabled)
-    return clib_error_return (0, "nat66 disabled");
+  CHECK_ENABLED ();
   vlib_cli_output (vm, "NAT66 static mappings:");
   nat66_static_mappings_walk (nat66_cli_static_mapping_walk, vm);
   return 0;
@@ -312,32 +328,19 @@
 
 /*?
  * @cliexpar
- * @cliexstart{nat66 enable}
- * Enable NAT66 plugin
+ * @cliexstart{nat66}
  * To enable NAT66 plugin
  *  vpp# nat66 enable
+ * To disable NAT66 plugin
+ *  vpp# nat66 disable
  * To enable NAT66 plugin with outside-vrf id 10
  *  vpp# nat66 enable outside-vrf 10
  * @cliexend
 ?*/
-VLIB_CLI_COMMAND (nat66_enable_command, static) = {
-  .path = "nat66 enable",
-  .short_help = "nat66 enable [outside-vrf <vrf-id>]",
-  .function = nat66_enable_command_fn,
-};
-
-/*?
- * @cliexpar
- * @cliexstart{nat66 disable}
- * Disable NAT66 plugin
- * To disable NAT66 plugin
- *  vpp# nat66 disable
- * @cliexend
-?*/
-VLIB_CLI_COMMAND (nat66_disable_command, static) = {
-  .path = "nat66 disable",
-  .short_help = "nat66 disable",
-  .function = nat66_disable_command_fn,
+VLIB_CLI_COMMAND (nat66_enable_disable_command, static) = {
+  .path = "nat66",
+  .short_help = "nat66 <enable [outside-vrf <vrf-id>]>|disable",
+  .function = nat66_enable_disable_command_fn,
 };
 
 /*?
