2017-03-12 17:13:07 -07:00
|
|
|
#include <iostream>
|
2017-03-22 19:02:14 -07:00
|
|
|
#include <map>
|
2017-03-12 17:13:07 -07:00
|
|
|
#include <string>
|
2017-03-12 22:33:42 -07:00
|
|
|
#include <vector>
|
2017-03-12 17:13:07 -07:00
|
|
|
|
2017-03-12 23:10:04 -07:00
|
|
|
#include "json.hpp"
|
2017-03-12 17:13:07 -07:00
|
|
|
|
2017-03-13 19:03:07 -07:00
|
|
|
#include "bottles.hpp"
|
2017-03-12 17:13:07 -07:00
|
|
|
|
2017-03-12 22:33:42 -07:00
|
|
|
using namespace std;
|
2017-03-22 19:02:14 -07:00
|
|
|
using namespace cellar;
|
2017-03-12 23:10:04 -07:00
|
|
|
using json = nlohmann::json;
|
2017-03-12 17:13:07 -07:00
|
|
|
|
2017-03-12 22:33:42 -07:00
|
|
|
int main(int argc, char* argv[]) {
|
2017-03-22 19:02:14 -07:00
|
|
|
map<string, bottles::Bottle> bottles = bottles::get_bottles();
|
|
|
|
for (auto& item : bottles) {
|
|
|
|
cout << item.first << "- ";
|
|
|
|
bottles::Bottle current = item.second;
|
|
|
|
|
|
|
|
switch (current.type) {
|
|
|
|
case bottles::bottle_anonymous:
|
|
|
|
cout << "anonymous wine bottle";
|
|
|
|
break;
|
|
|
|
case bottles::bottle_labelled:
|
|
|
|
cout << current.config["name"];
|
|
|
|
break;
|
|
|
|
case bottles::bottle_symlink:
|
|
|
|
cout << "symlink to ";
|
|
|
|
cout << current.canonical_path;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
cout << "broken or unsupported wine bottle";
|
|
|
|
}
|
|
|
|
|
|
|
|
cout << endl;
|
2017-03-12 22:33:42 -07:00
|
|
|
}
|
2017-03-13 19:03:07 -07:00
|
|
|
|
|
|
|
return 0;
|
2017-03-12 15:43:11 -07:00
|
|
|
}
|