20 printf(
"Usage: yarp-config context [OPTION]\n\n");
21 printf(
"Known values for OPTION are:\n\n");
22 printf(
" --help display this help and exit\n");
23 printf(
" --list list contexts that are available; add optional '--user', '--sysadm' or '--installed' parameters to limit the search locations\n");
25 printf(
" --import <context_name> import all the files of the specified context to home directory\n");
26 printf(
" --import <context_name> file1 file2 ... import specified context files to home directory\n");
27 printf(
" --import-all import all contexts to home directory\n");
28 printf(
" --remove <context_name> file1 file2 ... remove specified context files from home directory\n");
29 printf(
" --diff <context_name> find differences from the context in the home directory with respect to the installation directory\n");
30 printf(
" --diff-list list the contexts in the home directory that are different from the installation directory\n");
31 printf(
" --where <context_name> print full paths to the contexts that are found for <context_name> (the first one is the default one)\n");
32 printf(
" --merge <context_name> file1 file2 ... merge differences in selected files-directories\n");
40 if (options.
check(
"help")) {
44 if (options.
check(
"list")) {
46#ifndef YARP_NO_DEPRECATED
49 if (options.
check(
"verbose")) {
54 if(options.
check(
"user") || options.
check(
"sysadm") || options.
check(
"installed"))
56 if (options.
check(
"user")) {
59 if (options.
check(
"sysadm")) {
62 if (options.
check(
"installed")) {
75 if(options.
check(
"import"))
78#ifndef YARP_NO_DEPRECATED
85 if(options.
check(
"import-all"))
87#ifndef YARP_NO_DEPRECATED
94 if(options.
check(
"remove"))
97#ifndef YARP_NO_DEPRECATED
105 if(options.
check(
"where"))
110 printf(
"No context name provided\n");
114 if (options.
check(
"user") || options.
check(
"sysadm") || options.
check(
"installed"))
117 if (options.
check(
"user")) {
120 if (options.
check(
"sysadm")) {
123 if (options.
check(
"installed")) {
128#ifndef YARP_NO_DEPRECATED
131 if (options.
check(
"verbose")) {
165 if(options.
check(
"diff"))
170 printf(
"No context name provided\n");
173#ifndef YARP_NO_DEPRECATED
179 if(options.
check(
"diff-list"))
181#ifndef YARP_NO_DEPRECATED
187 if(options.
check(
"merge"))
190#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.
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.
int yarp_context_main(int argc, char *argv[])
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)