CLI: Added meta format pipe-xml-default for cli commands inside pipes

This commit is contained in:
Olof hagsand 2024-12-09 22:52:23 +01:00
parent c24c38dbb5
commit 2790d243e1
5 changed files with 21 additions and 294 deletions

View file

@ -189,8 +189,9 @@ enum format_enum{
FORMAT_JSON,
FORMAT_TEXT,
FORMAT_CLI,
FORMAT_NETCONF,
FORMAT_DEFAULT
FORMAT_NETCONF, /* Last concrete format, used in code */
FORMAT_DEFAULT, /* Indirect: actual value in CLICON_CLI_OUTPUT_FORMAT */
FORMAT_PIPE_XML_DEFAULT /* Meta: If pipe, xml, if not default */
};
/*

View file

@ -131,12 +131,13 @@ static const map_str2int yang_regexp_map[] = {
* @see enum format_enum
*/
static const map_str2int _FORMATS[] = {
{"xml", FORMAT_XML},
{"text", FORMAT_TEXT},
{"json", FORMAT_JSON},
{"cli", FORMAT_CLI},
{"netconf", FORMAT_NETCONF},
{"default", FORMAT_DEFAULT},
{"xml", FORMAT_XML},
{"text", FORMAT_TEXT},
{"json", FORMAT_JSON},
{"cli", FORMAT_CLI},
{"netconf", FORMAT_NETCONF},
{"default", FORMAT_DEFAULT},
{"pipe-xml-default", FORMAT_PIPE_XML_DEFAULT},
{NULL, -1}
};

View file

@ -937,7 +937,6 @@ yspec_new1(clixon_handle h,
* @param[in] h Clixon handle
* @param[in] xpath Mount xpath, saved in cvec
* @param[in] domain YANG domain
* @param[in] domain YANG spec name
* @param[in] yspec0 Input NULL if no previous shared exist, otherwise a shared yspec but new name
* @retval yspec1 New or (previously shared)
* @retval NULL Error