diff options
Diffstat (limited to 'TAO/CIAO/DAnCE/RepositoryManager/Options.cpp')
-rw-r--r-- | TAO/CIAO/DAnCE/RepositoryManager/Options.cpp | 111 |
1 files changed, 0 insertions, 111 deletions
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/Options.cpp b/TAO/CIAO/DAnCE/RepositoryManager/Options.cpp deleted file mode 100644 index 6503e01aa3e..00000000000 --- a/TAO/CIAO/DAnCE/RepositoryManager/Options.cpp +++ /dev/null @@ -1,111 +0,0 @@ -// $Id$ - -// Options.cpp,v Stoyan - -#include "ace/Get_Opt.h" -#include "ace/ARGV.h" -#include "Options.h" - - -bool -Options::parse_args (int argc, ACE_TCHAR *argv[]) -{ - ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("n:l:u:ifdsTNa")); - - int c; - - while ((c = get_opt ()) != -1) - switch (c) - { - case 'i': - this->install_ = true; - break; - case 'd': - this->delete_ = true; - break; - case 'f': - this->find_ = true; - break; - case 's': - this->shutdown_ = true; - break; - case 'n': - this->name_ = get_opt.opt_arg (); - break; - case 'l': - this->path_ = get_opt.opt_arg (); - break; - case 'u': - this->uuid_ = get_opt.opt_arg (); - break; - case 'N': - this->all_names_ = true; - break; - case 'T': - this->all_types_ = true; - break; - case 'a': - this->names_by_type_ = true; - break; - // Usage fallthrough. - default: - this->usage (); - return false; - } - - if ((this->name_ == "") - && (this->shutdown_ == false) - && (this->uuid_ == "") - && (this->all_names_ == false) - && (this->all_types_ == false)) - { - this->usage (); - return false; - } - else if (this->name_ != "") - { - if (!(this->install_ || this->find_ || this->delete_)) - { - this->usage (); - return false; - } - else if (this->install_ && this->path_ == "") - { - this->usage (); - return false; - } - } - else if (this->uuid_ != "") - { - if (!this->find_ && !this->names_by_type_) - { - this->usage (); - return false; - } - } - - return true; -} - -/// @todo Exit is not nice, return -1 so that the caller can do something and -/// we don't exit abruptly -void Options::usage (void) -{ - ACE_DEBUG ((LM_INFO, "OPTIONS: -s <shutdown> -n <:name> [-i <install> -l <:path>] \ - [-d <delete>] [-f <find>] [-u <:uuid> [-a <names by type>] ] \ - [-N <all names>] [-T <all types>]\n")); -} - -Options::Options (void) - : name_ (""), - uuid_ (""), - path_ (""), - delete_ (false), - install_ (false), - find_ (false), - all_names_ (false), - all_types_ (false), - names_by_type_ (false), - shutdown_ (false) -{ -} |