blob: 7e6d5f1590751f7a6bf9fb9d4b41f90d167c107f [file] [log] [blame]
Jan Kundrátdc2b0722018-03-02 14:13:37 +01001/*
2 * Copyright (C) 2018 CESNET, https://photonics.cesnet.cz/
Jan Kundráta2740442018-03-22 16:56:43 +01003 * Copyright (C) 2018 FIT CVUT, https://fit.cvut.cz/
Jan Kundrátdc2b0722018-03-02 14:13:37 +01004 *
Václav Kubernát624a8872018-03-02 17:28:47 +01005 * Written by Václav Kubernát <kubervac@fit.cvut.cz>
Jan Kundrátdc2b0722018-03-02 14:13:37 +01006 *
7*/
8
Václav Kubernát624a8872018-03-02 17:28:47 +01009#include <boost/spirit/home/x3.hpp>
Jan Kundrátdc2b0722018-03-02 14:13:37 +010010#include <docopt.h>
Václav Kubernát624a8872018-03-02 17:28:47 +010011#include <iostream>
Jan Kundrátdc2b0722018-03-02 14:13:37 +010012#include <string>
Václav Kubernát624a8872018-03-02 17:28:47 +010013#include "CParser.hpp"
14#include "CTree.hpp"
Jan Kundrátdc2b0722018-03-02 14:13:37 +010015#include "NETCONF_CLI_VERSION.h"
16
Václav Kubernát624a8872018-03-02 17:28:47 +010017
Jan Kundrátdc2b0722018-03-02 14:13:37 +010018static const char usage[] =
Václav Kubernát624a8872018-03-02 17:28:47 +010019 R"(CLI interface to remote NETCONF hosts
Jan Kundrátdc2b0722018-03-02 14:13:37 +010020
21Usage:
Václav Kubernát624a8872018-03-02 17:28:47 +010022 netconf-cli
Jan Kundrátdc2b0722018-03-02 14:13:37 +010023 netconf-cli (-h | --help)
24 netconf-cli --version
25)";
26
Václav Kubernát624a8872018-03-02 17:28:47 +010027namespace x3 = boost::spirit::x3;
28namespace ascii = boost::spirit::x3::ascii;
29
30using Cmd = std::vector<std::string>;
31using x3::alpha;
32using x3::lit;
33using x3::char_;
34using x3::_attr;
35using x3::lexeme;
36using ascii::space;
37
38
39std::string getInput()
40{
41 std::string line;
42 std::getline(std::cin, line);
43 return line;
44}
45
Jan Kundrátdc2b0722018-03-02 14:13:37 +010046int main(int argc, char* argv[])
47{
48 auto args = docopt::docopt(usage,
49 {argv + 1, argv + argc},
50 true,
51 "netconf-cli " NETCONF_CLI_VERSION,
52 true);
Václav Kubernát624a8872018-03-02 17:28:47 +010053 std::cout << "Welcome to netconf-cli" << std::endl;
Jan Kundrátdc2b0722018-03-02 14:13:37 +010054 return 0;
55}