@@ -146,7 +146,9 @@ cmd_data_help(void)
146146 " is supposed to contain the source 'nc-rpc' operation of the reply.\n"
147147 " -k, --ext-inst <name>\n"
148148 " Name of extension instance in format:\n"
149- " <module-name>:<extension-name>:<argument>\n" );
149+ " <module-name>:<extension-name>:<argument>\n"
150+ " -A, --anydata-strict\n"
151+ " Enable strict parsing of anydata content\n" );
150152 cmd_data_help_format ();
151153 cmd_data_help_in_format ();
152154 printf (" -o OUTFILE, --output=OUTFILE\n"
@@ -161,19 +163,20 @@ cmd_data_opt(struct yl_opt *yo, const char *cmdline, char ***posv, int *posc)
161163 int rc = 0 , argc = 0 ;
162164 int opt , opt_index ;
163165 struct option options [] = {
164- {"defaults" , required_argument , NULL , 'd' },
165- {"present" , no_argument , NULL , 'e' },
166- {"format" , required_argument , NULL , 'f' },
167- {"in-format" , required_argument , NULL , 'F' },
168- {"help" , no_argument , NULL , 'h' },
169- {"merge" , no_argument , NULL , 'm' },
170- {"output" , required_argument , NULL , 'o' },
171- {"operational" , required_argument , NULL , 'O' },
172- {"reply-rpc" , required_argument , NULL , 'R' },
173- {"not-strict" , no_argument , NULL , 'n' },
174- {"type" , required_argument , NULL , 't' },
175- {"xpath" , required_argument , NULL , 'x' },
176- {"ext-inst" , required_argument , NULL , 'k' },
166+ {"defaults" , required_argument , NULL , 'd' },
167+ {"present" , no_argument , NULL , 'e' },
168+ {"format" , required_argument , NULL , 'f' },
169+ {"in-format" , required_argument , NULL , 'F' },
170+ {"help" , no_argument , NULL , 'h' },
171+ {"merge" , no_argument , NULL , 'm' },
172+ {"output" , required_argument , NULL , 'o' },
173+ {"operational" , required_argument , NULL , 'O' },
174+ {"reply-rpc" , required_argument , NULL , 'R' },
175+ {"not-strict" , no_argument , NULL , 'n' },
176+ {"anydata-strict" , no_argument , NULL , 'A' },
177+ {"type" , required_argument , NULL , 't' },
178+ {"xpath" , required_argument , NULL , 'x' },
179+ {"ext-inst" , required_argument , NULL , 'k' },
177180 {NULL , 0 , NULL , 0 }
178181 };
179182
@@ -242,6 +245,10 @@ cmd_data_opt(struct yl_opt *yo, const char *cmdline, char ***posv, int *posc)
242245 case 'n' : /* --not-strict */
243246 yo -> data_parse_options &= ~LYD_PARSE_STRICT ;
244247 break ;
248+ case 'A' : /* --anydata-strict */
249+ yo -> data_parse_options |= LYD_PARSE_ANYDATA_STRICT ;
250+ break ;
251+
245252 case 't' : /* --type */
246253 if (data_type_set ) {
247254 YLMSG_E ("The data type (-t) cannot be set multiple times." );
0 commit comments