Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (34 sloc) 1.06 KB
/*
* yadfs.c
* yadfs
*
* Created by Cayzac Julien on 5/19/11.
* Copyright 2011 -. All rights reserved.
*
*/
#include <string>
#include <iostream>
#include <boost/program_options.hpp>
namespace po = boost::program_options;
#include "yadfs.h"
int main(int argc, char* argv[]) {
po::options_description desc("Allowed options");
desc.add_options()
("help", "produce this message")
("server", po::value<std::string>(), "set YAD server")
("mountpoint", po::value<std::string>(), "set local mountpoint")
("name", po::value<std::string>(), "set volume name, as shown in Finder")
;
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm);
po::notify(vm);
if (vm.count("help") || !vm.count("server") || !vm.count("mountpoint")) {
std::cerr << desc << "\n";
return 1;
}
std::string server(vm["server"].as<std::string>());
std::string mountpoint(vm["mountpoint"].as<std::string>());
std::string name("YADFS Volume");
if (vm.count("name")) name=vm["name"].as<std::string>();
return YADFS::run(server, mountpoint, name);
}