+static clib_error_t *
+test_format_vlib_command_fn (vlib_main_t * vm,
+ unformat_input_t * input,
+ vlib_cli_command_t * cmd)
+{
+ unformat_input_t _i, *i = &_i;
+ int enable = -1, disable = -1;
+ int twenty_seven = -1;;
+ int rxtx = -1;
+
+ memset (i, 0, sizeof (*i));
+ unformat_init_string (i, "enable disable rx tx 27", 23);
+
+ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (i, "%U", unformat_vlib_enable_disable, &enable))
+ ;
+ else if (unformat (i, "%U", unformat_vlib_enable_disable, &disable))
+ ;
+ else if (unformat (i, "%U", unformat_vlib_number, &twenty_seven))
+ ;
+ else if (unformat (i, "%U", unformat_vlib_rx_tx, &rxtx))
+ ;
+ else
+ break;
+ }
+
+ rxtx = VLIB_TX;
+ vlib_cli_output (vm, "%U", format_vlib_read_write, rxtx);
+ vlib_cli_output (vm, "%U", format_vlib_rx_tx, rxtx);
+
+ rxtx = VLIB_RX;
+ vlib_cli_output (vm, "%U", format_vlib_read_write, rxtx);
+ vlib_cli_output (vm, "%U", format_vlib_rx_tx, rxtx);
+ rxtx = 12345;
+ vlib_cli_output (vm, "%U", format_vlib_read_write, rxtx);
+ vlib_cli_output (vm, "%U", format_vlib_rx_tx, rxtx);
+
+ unformat_free (i);
+ return 0;
+}
+
+/* *INDENT-OFF* */
+VLIB_CLI_COMMAND (test_format_vlib_command, static) =
+{
+ .path = "test format-vlib",
+ .short_help = "vlib format code coverate unit test",
+ .function = test_format_vlib_command_fn,
+};
+/* *INDENT-ON* */
+