summaryrefslogtreecommitdiffstats
path: root/src/vlib/cli.h
AgeCommit message (Collapse)AuthorFilesLines
2022-05-14session: revert "fix session cli maybe parse wrong args if executed in files"Damjan Marion1-1/+0
Fixed at infra level. Type: improvement Change-Id: I43cf16870c1d2e12189073f7786d62375c46e2c2 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-05-13vlib: process startup config exec scripts line by lineDamjan Marion1-0/+1
This fixes long standing annoyance that CLIs with optional args cannot be executed from file, as they cannot distinguish between valid optional args and next line in the file. Multiline statements can be provided simply by using backslash before \n. Also comments are supported - everything after # is ignored up to the end of the line. Example: # multiline cli using backslash show version \ verbose # end of line comment packet-generator new { \ name x \ limit 5 \ # comment inside cmultiline cli \ size 128-128 \ interface local0 \ node null-node \ data { \ incrementing 30 \ } \ } Type: fix Change-Id: Ia6d588169bae14e6e3f18effe94820d05ace1dbf Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-05-06session: fix session cli maybe parse wrong args if executed in filesXiaoming Jiang1-0/+1
Type: fix Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com> Change-Id: Id19a52df4f237cf5d85d305fdc279ab7df2d6f4b
2021-03-26vlib: split vlib_main_t into global and per-threadDamjan Marion1-21/+21
Type: refactor Change-Id: I8b273bc3bf16aa360f031f1b2692f766e5fc4613 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-02-18vlib: add a "vpplog" debug CLIDave Barach1-0/+5
To add arbitrary text to the vlib log. Combines nicely with comment/uncomment and the macro expander: define MY_FEATURE uncomment # or comment ... $(MY_FEATURE) { vpplog { My feature was enabled } } Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ia019f0a8fa670d8593ae01595f5ef410796e5b1c
2020-07-16misc: add callback hooks and refactor pmcTom Seidenberg1-1/+7
Callbacks for monitoring and performance measurement: - Add new callback list type, with context - Add callbacks for API, CLI, and barrier sync - Modify node dispatch callback to pass plugin-specific context - Modify perfmon plugin to keep PMC samples local to the plugin - Include process nodes in dispatch callback - Pass dispatch function return value to callback Type: refactor Signed-off-by: Tom Seidenberg <tseidenb@cisco.com> Change-Id: I28b06c58490611e08d76ff5b01b2347ba2109b22
2019-12-09vlib: improve test coverageDave Barach1-9/+0
Add tests. Remove unused rule-based parser code. Type: test Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I3ca3a9dd9da8ee8f3a47004c98f2f5644db10057
2019-11-02vlib: enhance the "show cli" debug CLI commandDave Barach1-0/+6
Dump the entire CLI, mp-safe commands, non-mp-safe commands, commands which have been executed. Optionally, clear the hit counters. Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ie38fc664b7deaabc35ca35be68db7e159272f551
2019-05-10cli: Add return value in cli_inbandOle Troan1-4/+4
Even when a CLI command called through the cli_inband API failed the API would return 0 (SUCCESS). This patch fixes that, but since most CLI handlers return error->code == 0, in most failure cases it will return -1 (UNSPECIFIED ERROR). Type: fix Change-Id: Ic83f3b23e8e8954bb8aa211301baba24e8c20ef6 Signed-off-by: Ole Troan <ot@cisco.com>
2018-08-13Multiarch handling in different constructor macrosDamjan Marion1-0/+8
This significantly reduces need for ... in multiarch code. Simply constructor macros will jost create static unused entry if CLIB_MARCH_VARIANT is defined and that will be optimized out by compiler. Change-Id: I17d1c4ac0c903adcfadaa4a07de1b854c7ab14ac Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-04-09plugins: unload plugin if early init failsDamjan Marion1-0/+9
Change-Id: I32f68e2ee8f5d32962acdefb0193583f71d342b3 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-05-23Add TAB-based auto-completion to the CLIYoann Desmouceaux1-0/+4
Hitting tab: - in the middle of a uniquely defined subcommand will expand the subcommand - in the middle of a non-uniquely defined (or empty) subcommand will display all possible subcommands, and possibly expand to the lowest common prefix Change-Id: Ib858eefdb0353cd2c3aad472799d15cd537455a0 Signed-off-by: Yoann Desmouceaux <ydesmouc@cisco.com>
2016-12-28Reorganize source tree to use single autotools instanceDamjan Marion1-0/+192
Change-Id: I7b51f88292e057c6443b12224486f2d0c9f8ae23 Signed-off-by: Damjan Marion <damarion@cisco.com>