Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniele Pallastrelli committed Apr 14, 2019
1 parent 27b45e6 commit 4f19a96
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 62 deletions.
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# Changelog

Current Version: 1.0-dirty
Current Version: 1.1

## Unreleased
## [1.1.0] - 2019-04-14

- Dynamically Remove/Disable/Enable commands and submenus (issue #15)
- New variadic template method to add commands and menu (makes Add() deprecated)
- Optionally delimitate string parameters by " (issue #38)
- Explicitly set the names of parameters in help description
- Unit tests
- CMake support
- Unit test
- Vcpkg support

## [1.0.0] - 2019-02-16

Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@

cmake_minimum_required(VERSION 3.8)

project(cli VERSION 1.0 LANGUAGES CXX)
project(cli VERSION 1.1 LANGUAGES CXX)

option(CLI_BuildExamples "Build the examples." OFF)
option(CLI_BuildTests "Build the unit tests." OFF)

find_package(Boost 1.55 REQUIRED COMPONENTS system)
find_package(Threads REQUIRED)
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ A cross-platform header only C++14 library for interactive command line interfac
* Async interface
* Colors

## How to get CLI library

* From [GitHub](https://github.com/daniele77/cli/releases)
* Using [Vcpkg](https://github.com/Microsoft/vcpkg)

## Dependencies

The library depends on boost asio (to provide telnet server)
Expand Down Expand Up @@ -47,7 +52,7 @@ and, if you want to specify the installation path:
## Compilation of the examples

You can find some examples in the directory "examples".
Each .cpp file corresponds to an executable. You can compile each sample by including
Each .cpp file corresponds to an executable. You can compile each example by including
cli and boost header files and linking boost system (and pthread on linux).

To compile the examples using cmake, use:
Expand All @@ -57,7 +62,7 @@ To compile the examples using cmake, use:
cmake .. -DCLI_BuildExamples=ON
make all

In the directory examples you can also find:
In the same directory you can also find:

* a GNU make file (Makefile)
* a Windows nmake file (makefile.win)
Expand Down
2 changes: 1 addition & 1 deletion doc/doxy/Doxyfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
################################################################################
# CLI - A simple command line interface.
# Copyright (C) 2016-2019 Daniele Pallastrelli
# Copyright (C) 2019 Daniele Pallastrelli
#
# Boost Software License - Version 1.0 - August 17th, 2003
#
Expand Down
8 changes: 4 additions & 4 deletions test/makefile.win
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@

# usage:
# set env var BOOST to boost lib path
# nmake /f makefile.win32
# nmake /f makefile.win
# or
# nmake /f makefile.win32 DEBUG=1
# nmake /f makefile.win DEBUG=1
# or
# nmake /f makefile.win32 UNICODE=1
# nmake /f makefile.win UNICODE=1
# or
# nmake /f makefile.win32 DEBUG=1 UNICODE=1
# nmake /f makefile.win DEBUG=1 UNICODE=1

#define macros
EXE_NAME = test_suite.exe
Expand Down
84 changes: 33 additions & 51 deletions test/test_history.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,6 @@ using namespace cli::detail;

BOOST_AUTO_TEST_SUITE(HistorySuite)

/*
content
- time_0_cmd
- time_1_cmd
- time_2_cmd
- time_3_cmd
- current_editing
arrow up goes through:
- current_editing
- time_3_cmd
- time_2_cmd
- time_1_cmd
- time_0_cmd (and stops here)
arrow down stops at "current_editing"
*/

BOOST_AUTO_TEST_CASE(NotFull)
{
History history(10);
Expand All @@ -63,48 +45,48 @@ BOOST_AUTO_TEST_CASE(NotFull)

BOOST_CHECK_EQUAL(history.Previous(""), "item4");
BOOST_CHECK_EQUAL(history.Next(), "");
BOOST_CHECK_EQUAL(history.Previous(""), "item4");
BOOST_CHECK_EQUAL(history.Previous("item4"), "item3");
BOOST_CHECK_EQUAL(history.Previous("item3"), "item2");
BOOST_CHECK_EQUAL(history.Previous("item2"), "item1");
BOOST_CHECK_EQUAL(history.Previous("item1"), "item1");
}

#if 0
BOOST_AUTO_TEST_CASE(Full)
{
History history(3);
history.Add("item1");
history.Add("item2");
history.Add("item3");
history.Add("item4");
history.NewCommand("item1");
history.NewCommand("item2");
history.NewCommand("item3");
history.NewCommand("item4");

BOOST_CHECK_EQUAL(history.GetCurrent(), "item4");
history.ToPreviousEntry();
BOOST_CHECK_EQUAL(history.GetCurrent(), "item3");
history.ToNextEntry();
BOOST_CHECK_EQUAL(history.GetCurrent(), "item4");
history.ToNextEntry();
BOOST_CHECK_EQUAL(history.GetCurrent(), "item4");
history.ToNextEntry();
BOOST_CHECK_EQUAL(history.GetCurrent(), "item4");
BOOST_CHECK_EQUAL(history.Previous(""), "item4");
BOOST_CHECK_EQUAL(history.Next(), "");
BOOST_CHECK_EQUAL(history.Previous(""), "item4");
BOOST_CHECK_EQUAL(history.Previous("item4"), "item3");
BOOST_CHECK_EQUAL(history.Previous("item3"), "item3");
BOOST_CHECK_EQUAL(history.Previous("item3"), "item3");
BOOST_CHECK_EQUAL(history.Previous("item3"), "item3");
BOOST_CHECK_EQUAL(history.Next(), "item4");
BOOST_CHECK_EQUAL(history.Next(), "");
}

history.ToPreviousEntry();
BOOST_CHECK_EQUAL(history.GetCurrent(), "item3");
history.ToPreviousEntry();
BOOST_CHECK_EQUAL(history.GetCurrent(), "item2");
history.ToPreviousEntry();
BOOST_CHECK_EQUAL(history.GetCurrent(), "item2");
history.ToPreviousEntry();
BOOST_CHECK_EQUAL(history.GetCurrent(), "item2");

history.ToNextEntry();
BOOST_CHECK_EQUAL(history.GetCurrent(), "item3");
history.ToNextEntry();
BOOST_CHECK_EQUAL(history.GetCurrent(), "item4");
history.ToPreviousEntry();
BOOST_CHECK_EQUAL(history.GetCurrent(), "item3");
history.ToPreviousEntry();
BOOST_CHECK_EQUAL(history.GetCurrent(), "item2");
BOOST_AUTO_TEST_CASE(Insertion)
{
History history(10);
history.NewCommand("item1");
history.NewCommand("item2");
history.NewCommand("item3");
history.NewCommand("item4");

history.ResetCurrent();
BOOST_CHECK_EQUAL(history.GetCurrent(), "item4");
BOOST_CHECK_EQUAL(history.Previous(""), "item4");
BOOST_CHECK_EQUAL(history.Previous("item4"), "item3");
BOOST_CHECK_EQUAL(history.Previous("foo"), "item2");
BOOST_CHECK_EQUAL(history.Next(), "foo");
BOOST_CHECK_EQUAL(history.Next(), "item4");
BOOST_CHECK_EQUAL(history.Previous("item4"), "foo");
BOOST_CHECK_EQUAL(history.Previous("foo"), "item2");
}
#endif

BOOST_AUTO_TEST_SUITE_END()

0 comments on commit 4f19a96

Please sign in to comment.