summaryrefslogtreecommitdiff
path: root/src/cli_shell_api.cpp
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2010-08-12 17:47:05 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2010-08-12 17:47:05 -0700
commit95c385ceffe94eb7216dbb09eb7bb107ae1cf67b (patch)
tree590732f9fe6ab62931a602d8e66f72634ce32535 /src/cli_shell_api.cpp
parent4f27807c73940d66fb632ba8b18700ce1047ddbf (diff)
downloadvyatta-cfg-95c385ceffe94eb7216dbb09eb7bb107ae1cf67b.tar.gz
vyatta-cfg-95c385ceffe94eb7216dbb09eb7bb107ae1cf67b.zip
add more functions to shell API
Diffstat (limited to 'src/cli_shell_api.cpp')
-rw-r--r--src/cli_shell_api.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/cli_shell_api.cpp b/src/cli_shell_api.cpp
index f0ac34f..1a4f469 100644
--- a/src/cli_shell_api.cpp
+++ b/src/cli_shell_api.cpp
@@ -368,6 +368,26 @@ returnEffectiveValues(const vector<string>& args)
print_vec(vvec, " ", "'");
}
+/* checks if specified path is a valid "template path" *without* checking
+ * the validity of any "tag values" along the path.
+ */
+static void
+validateTmplPath(const vector<string>& args)
+{
+ UnionfsCstore cstore(true);
+ exit(cstore.validateTmplPath(args, false) ? 0 : 1);
+}
+
+/* checks if specified path is a valid "template path", *including* the
+ * validity of any "tag values" along the path.
+ */
+static void
+validateTmplValPath(const vector<string>& args)
+{
+ UnionfsCstore cstore(true);
+ exit(cstore.validateTmplPath(args, true) ? 0 : 1);
+}
+
#define OP(name, exact, exact_err, min, min_err) \
{ #name, exact, exact_err, min, min_err, &name }
@@ -407,6 +427,9 @@ static OpT ops[] = {
OP(returnActiveValues, -1, NULL, 1, "Must specify config path"),
OP(returnEffectiveValues, -1, NULL, 1, "Must specify config path"),
+ OP(validateTmplPath, -1, NULL, 1, "Must specify config path"),
+ OP(validateTmplValPath, -1, NULL, 1, "Must specify config path"),
+
{NULL, -1, NULL, -1, NULL, NULL}
};
#define OP_exact_args ops[op_idx].op_exact_args