summaryrefslogtreecommitdiff
path: root/src/cli_bin.cpp
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2011-01-05 16:44:31 -0800
committerAn-Cheng Huang <ancheng@vyatta.com>2011-01-05 16:52:12 -0800
commitd4111b01462641baa21978a78390215987a5958a (patch)
treee6a53a4f19f8b197aeb45879d90384b8fd2538d1 /src/cli_bin.cpp
parent15022218e4e6983c661ccf1e7beefd598a96e628 (diff)
downloadvyatta-cfg-d4111b01462641baa21978a78390215987a5958a.tar.gz
vyatta-cfg-d4111b01462641baa21978a78390215987a5958a.zip
fix for bug 6641
* change shell API to only use "edit level" when needed. * add factory functions for cstore creation to simplify code. (cherry picked from commit 2208bfef1004295d3227492c6a3e9d7b36903db5)
Diffstat (limited to 'src/cli_bin.cpp')
-rw-r--r--src/cli_bin.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/cli_bin.cpp b/src/cli_bin.cpp
index 9528277..e8ff95a 100644
--- a/src/cli_bin.cpp
+++ b/src/cli_bin.cpp
@@ -15,13 +15,14 @@
*/
#include <cstdio>
+#include <cstdlib>
#include <cstring>
#include <vector>
#include <string>
#include <libgen.h>
#include <cli_cstore.h>
-#include <cstore/unionfs/cstore-unionfs.hpp>
+#include <cstore/cstore.hpp>
static int op_idx = -1;
static const char *op_bin_name[] = {
@@ -218,14 +219,15 @@ main(int argc, char **argv)
}
// actual CLI operations use the edit levels from environment, so pass true.
- UnionfsCstore cstore(true);
+ Cstore *cstore = Cstore::createCstore(true);
vector<string> path_comps;
for (int i = 1; i < argc; i++) {
path_comps.push_back(argv[i]);
}
// call the op function
- OpFunc[op_idx](cstore, path_comps);
+ OpFunc[op_idx](*cstore, path_comps);
+ delete cstore;
exit(0);
}