CASM  1.1.0
A Clusters Approach to Statistical Mechanics
complete.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <iterator>
5 
6 using namespace CASM;
7 
8 namespace CASM {
9  namespace Completer {
11  Completer::Engine casm_engine;
12 
13  // TODO: Fix includes
14 
15  //QueryOption dumbquery;
16  //casm_engine.push_back(Option(dumbquery.tag(), dumbquery.desc()));
17 
18  MonteOption dumbmonte;
19  casm_engine.push_back(Option(dumbmonte.tag(), dumbmonte.desc()));
20 
21  RunOption dumbrun;
22  casm_engine.push_back(Option(dumbrun.tag(), dumbrun.desc()));
23 
24  BsetOption dumbbset;
25  casm_engine.push_back(Option(dumbbset.tag(), dumbbset.desc()));
26 
27  CompositionOption dumbcomposition;
28  casm_engine.push_back(Option(dumbcomposition.tag(), dumbcomposition.desc()));
29 
30  RefOption dumbref;
31  casm_engine.push_back(Option(dumbref.tag(), dumbref.desc()));
32 
33  FilesOption dumbfiles;
34  casm_engine.push_back(Option(dumbfiles.tag(), dumbfiles.desc()));
35 
36  FormatOption dumbformat;
37  casm_engine.push_back(Option(dumbformat.tag(), dumbformat.desc()));
38 
39  //ImportOption dumbimport;
40  //casm_engine.push_back(Option(dumbimport.tag(), dumbimport.desc()));
41 
42  InitOption dumbinit;
43  casm_engine.push_back(Option(dumbinit.tag(), dumbinit.desc()));
44 
45  PerturbOption dumbperturb;
46  casm_engine.push_back(Option(dumbperturb.tag(), dumbperturb.desc()));
47 
48  //SelectOption dumbselect;
49  //casm_engine.push_back(Option(dumbselect.tag(), dumbselect.desc()));
50 
51  SettingsOption dumbsettings;
52  casm_engine.push_back(Option(dumbsettings.tag(), dumbsettings.desc()));
53 
54  StatusOption dumbstatus;
55  casm_engine.push_back(Option(dumbstatus.tag(), dumbstatus.desc()));
56 
57  SuperOption dumbsuper;
58  casm_engine.push_back(Option(dumbsuper.tag(), dumbsuper.desc()));
59 
60  SymOption dumbsym;
61  casm_engine.push_back(Option(dumbsym.tag(), dumbsym.desc()));
62 
63  //UpdateOption dumbupdate;
64  //casm_engine.push_back(Option(dumbupdate.tag(), dumbupdate.desc()));
65 
66  ViewOption dumbview;
67  casm_engine.push_back(Option(dumbview.tag(), dumbview.desc()));
68 
69  //EnumOption dumbenum;
70  //casm_engine.push_back(Option(dumbenum.tag(), dumbenum.desc()));
71 
72  return casm_engine;
73  }
74  }
75 }
76 
77 int main(int argc, char *argv[]) {
78 
79 
81 
82 
83  if(argc == 1) {
84  std::cout << casm_engine.probe_options();
85  }
86 
87  if(argc == 2) {
88  std::cout << casm_engine.probe_suboptions(argv[1]);
89  }
90 
91  if(argc == 3) {
92  std::cout << casm_engine.probe_arguments(argv[1], argv[2]);
93  }
94 
95  return 0;
96 }
std::vector< std::string > probe_options() const
Get a list of all available options.
Definition: Complete.cc:162
std::vector< std::string > probe_suboptions(const std::string &option_tag) const
For a particular option, get the available suboptions.
Definition: Complete.cc:178
std::vector< std::string > probe_arguments(const std::string &option_tag, const std::string &suboption_tag) const
Return the arguments that should be bash completed.
Definition: Complete.cc:197
void push_back(const Option &new_option)
Append a new option to the engine.
Definition: Complete.cc:310
const po::options_description & desc()
Get the program options, filled with the initialized values.
Definition: Handlers.cc:321
const std::string & tag() const
Definition: Handlers.cc:307
int main(int argc, char *argv[])
Definition: complete.cpp:77
Engine build_casm_engine()
Definition: complete.cpp:10
Main CASM namespace.
Definition: APICommand.hh:8