19 printf(
"Usage: yarp-config robot [OPTION]\n\n");
20 printf(
"Known values for OPTION are:\n\n");
21 printf(
" --help display this help and exit\n");
22 printf(
" --list list robots that are available; add optional '--user', '--sysadm' or '--installed' parameters to limit the search locations\n");
24 printf(
" --import <robot_name> import specified robot files to home directory\n");
25 printf(
" --import-all-robots import all robots to home directory\n");
26 printf(
" --remove <robot_name> remove specified robot files from home directory\n");
27 printf(
" --diff <robot_name> find differences from the robot in the home directory with respect to the installation directory\n");
28 printf(
" --diff-list list the robots in the home directory that are different from the installation directory\n");
30 printf(
" --merge <robot_name> file1 file2 ... merge differences in selected files-directories\n");
38 if (options.
check(
"help")) {
42 if (options.
check(
"list")) {
44#ifndef YARP_NO_DEPRECATED
47 if (options.
check(
"verbose")) {
52 if(options.
check(
"user") || options.
check(
"sysadm") || options.
check(
"installed"))
54 if (options.
check(
"user")) {
57 if (options.
check(
"sysadm")) {
60 if (options.
check(
"installed")) {
73 if(options.
check(
"import"))
76#ifndef YARP_NO_DEPRECATED
83 if(options.
check(
"import-all-robots"))
85#ifndef YARP_NO_DEPRECATED
92 if(options.
check(
"remove"))
96#ifndef YARP_NO_DEPRECATED
103 if(options.
check(
"where"))
108 printf(
"No robot name provided\n");
112 if (options.
check(
"user") || options.
check(
"sysadm") || options.
check(
"installed"))
115 if (options.
check(
"user")) {
118 if (options.
check(
"sysadm")) {
121 if (options.
check(
"installed")) {
126#ifndef YARP_NO_DEPRECATED
129 if (options.
check(
"verbose")) {
141 if(options.
check(
"current"))
144 if (result.empty()) {
145 printf(
"Current robot is %s, identified by the environment variable YARP_ROBOT_NAME\n", result.c_str());
147 printf(
"No robot is set; please set the YARP_ROBOT_NAME environment variable.\n");
175 if(options.
check(
"diff"))
180 printf(
"No robot name provided\n");
183#ifndef YARP_NO_DEPRECATED
189 if(options.
check(
"diff-list"))
191#ifndef YARP_NO_DEPRECATED
197 if(options.
check(
"merge"))
200#ifndef YARP_NO_DEPRECATED
A simple collection of objects that can be described and transmitted in a portable way.
A mini-server for performing network communication in the background.
A class for storing options and configuration information.
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
bool check(const std::string &key) const override
Check if there exists a property of the given name.
Bottle & findGroup(const std::string &key) const override
Gets a list corresponding to a given keyword.
void fromCommand(int argc, char *argv[], bool skipFirst=true, bool wipe=true)
Interprets a list of command arguments as a list of properties.
These options are loosely based on http://wiki.icub.org/wiki/YARP_ResourceFinder.
Helper class for finding config files and other external resources.
yarp::os::Bottle findPaths(const std::string &name)
Expand a partial path to a list of paths.
bool setVerbose(bool verbose=true)
Request that information be printed to the console on how resources are being found.
virtual std::string asString() const
Get string value.
std::string get_string(const std::string &key, bool *found=nullptr)
Read a string from an environment variable.
An interface to the operating system, including Port based communication.
#define YARP_WARNING_POP
Ends a temporary alteration of the enabled warnings.
#define YARP_WARNING_PUSH
Starts a temporary alteration of the enabled warnings.
#define YARP_DISABLE_DEPRECATED_WARNING
Disable deprecated warnings in the following code.
void printSysadmFolders(yarp::os::ResourceFinder &rf, folderType ftype)
void printInstalledFolders(yarp::os::ResourceFinder &rf, folderType ftype)
void printUserFolders(yarp::os::ResourceFinder &rf, folderType ftype)
int remove(yarp::os::Bottle &removeArg, folderType fType, bool verbose)
int diffList(folderType fType, bool verbose)
int diff(std::string contextName, folderType fType, bool verbose)
int importAll(folderType fType, bool verbose)
int merge(yarp::os::Bottle &mergeArg, folderType fType, bool verbose)
int yarp_robot_main(int argc, char *argv[])