git commit -a doesn't add untracked files, you idiot stoner

This commit is contained in:
Nicholas O'Connor 2017-03-24 22:06:03 -07:00
parent 5024b69dcb
commit 02571218bd
2 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,28 @@
// vim: filetype=cpp :
#ifndef __INTERNAL_CORE_HPP
#define __INTERNAL_CORE_HPP
#pragma once
#include <map>
#include <string>
#include "commands.hpp"
using namespace cellar::commands;
namespace cellar {
namespace commands {
/*[[[cog
import cog
with open("src/commands.txt") as commandsfile:
for line in commandsfile:
item = line.strip().split(" ")
cog.outl("extern void {0} (int, vector<string>);".format(item[1]))
]]]*/
//[[[end]]]
extern map<string, cellar::commands::CommandFunction> core_commands();
}
}
#endif // __INTERNAL_CORE_HPP

27
src/help/help.cpp Normal file
View File

@ -0,0 +1,27 @@
#include <string>
#include <vector>
#include "cellar.hpp"
#include "internal/core.hpp"
using namespace std;
void cellar::commands::help_command(int argc, vector<string> argv) {
vector<string> commands = list_commands();
cellar::print_header();
cout << "You have these commands:\n" << endl;
int num_columns = 4;
int cur_column = 1;
for (string command : commands) {
cout << "\t" << command;
if (cur_column == num_columns) {
cout << endl;
cur_column = 1;
} else {
cur_column++;
}
}
cout << endl;
}