Skip to content

Commit

Permalink
1.0 cleanup
Browse files Browse the repository at this point in the history
Cleanup includes and comments for v1.0. No functionality change. Bump version number to 1.0
  • Loading branch information
zyx-billy committed Apr 16, 2018
1 parent ae005ba commit 95f5878
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 37 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 2.8)
project(autolab-cli)

# The version number
set(VERSION_MAJOR 0)
set(VERSION_MINOR 7)
set(VERSION_MAJOR 1)
set(VERSION_MINOR 0)

# command line options
option(release "build release version (no debug output)" OFF)
Expand Down
3 changes: 2 additions & 1 deletion src/cache/cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

#include "logger.h"

#include "cache.h"
#include "../context_manager/context_manager.h"
#include "../file/file_utils.h"

#include "cache.h"

const std::string courses_cache_filename = "courses.txt";
const std::string cache_dirname = "cache";

Expand Down
13 changes: 4 additions & 9 deletions src/cmd/cmdimp.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// I literally just copied the imports from main.cpp, so not all of these are
// necessary
#include <cmath>
#include <ctime>

Expand All @@ -12,22 +10,19 @@
#include <thread> // sleep_for
#include <vector>

#include <fstream>

#include "autolab/autolab.h"
#include "autolab/client.h"
#include "logger.h"

#include "../app_credentials.h"
#include "build_config.h"
#include "cmdargs.h"
#include "../cache/cache.h"
#include "../context_manager/context_manager.h"
#include "../file/file_utils.h"
#include "../pretty_print/pretty_print.h"
#include "cmdmap.h"
#include "cmdimp.h"

#include "cmdargs.h"
#include "../cache/cache.h"
#include "cmdimp.h"
#include "cmdmap.h"

Autolab::Client client(server_domain, client_id, client_secret, redirect_uri, store_tokens);

Expand Down
8 changes: 5 additions & 3 deletions src/cmd/cmdimp.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#ifndef CMDIMP
#define CMDIMP
#ifndef AUTOLAB_CMDIMP_H_
#define AUTOLAB_CMDIMP_H_

#include "autolab/client.h"

#include "cmdargs.h"

bool init_autolab_client();
int perform_device_flow(Autolab::Client &client);

Expand All @@ -21,4 +23,4 @@ int manage_enrolls(cmdargs &cmd);

extern Autolab::Client client;

#endif
#endif /* AUTOLAB_CMDIMP_H_ */
3 changes: 2 additions & 1 deletion src/cmd/cmdmap.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "cmdmap.h"
#include "logger.h"

#include "cmdimp.h"
#include "cmdmap.h"

int CommandMap::exec_command(cmdargs &cmd, std::string raw_command) {
// Translate to default command name and check if it's valid
Expand Down
5 changes: 5 additions & 0 deletions src/cmd/cmdmap.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#ifndef AUTOLAB_CMDMAP_H_
#define AUTOLAB_CMDMAP_H_

#include <string>
#include <vector>

Expand Down Expand Up @@ -47,3 +50,5 @@ class CommandMap {
CLI uses for its operations.
*/
CommandMap init_autolab_command_map();

#endif /* AUTOLAB_CMDMAP_H_ */
22 changes: 1 addition & 21 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@
#include <cmath>
#include <ctime>

#include <algorithm>
#include <chrono>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
#include <thread> // sleep_for
#include <vector>

#include "autolab/autolab.h"
#include "autolab/client.h"
#include "logger.h"

#include "app_credentials.h"
#include "build_config.h"
#include "cmd/cmdargs.h"
#include "context_manager/context_manager.h"
#include "file/file_utils.h"
#include "pretty_print/pretty_print.h"
#include "cmd/cmdmap.h"
#include "cmd/cmdimp.h"
#include "cmd/cmdmap.h"

extern Autolab::Client client;

Expand Down Expand Up @@ -157,13 +144,6 @@ int main(int argc, char *argv[]) {

try {
command_map.exec_command(cmd, command);
if(!cmd.has_option("-q", "--quiet")) {
// Yeah, we had something useful here
// Until we removed it
// Now we don't have time to refactor everything that uses '-q'
// So here it is, hopefully you'll need it for something
// TODO: Fix this :)
}
} catch (Autolab::InvalidTokenException &e) {
Logger::fatal << "Authorization invalid or expired." << Logger::endl
<< Logger::endl
Expand Down

0 comments on commit 95f5878

Please sign in to comment.