mirror of
https://github.com/GothenburgBitFactory/taskshell.git
synced 2025-08-23 14:36:47 +02:00
Review: Now stops after 'limit' tasks
This commit is contained in:
parent
a84e00175c
commit
61886b29ef
1 changed files with 5 additions and 4 deletions
|
@ -29,6 +29,7 @@
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <algorithm>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#ifdef HAVE_READLINE
|
#ifdef HAVE_READLINE
|
||||||
|
@ -174,10 +175,10 @@ static const std::string menu ()
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
static void reviewLoop (const std::vector <std::string>& uuids, int limit)
|
static void reviewLoop (const std::vector <std::string>& uuids, unsigned int limit)
|
||||||
{
|
{
|
||||||
auto reviewed = 0;
|
unsigned int reviewed = 0;
|
||||||
auto total = uuids.size ();
|
auto total = std::min (static_cast <unsigned int> (uuids.size ()), limit);
|
||||||
auto width = getWidth ();
|
auto width = getWidth ();
|
||||||
|
|
||||||
if (total == 0)
|
if (total == 0)
|
||||||
|
@ -238,7 +239,7 @@ static void reviewLoop (const std::vector <std::string>& uuids, int limit)
|
||||||
int cmdReview (const std::vector <std::string>& args)
|
int cmdReview (const std::vector <std::string>& args)
|
||||||
{
|
{
|
||||||
// Is there a specified limit?
|
// Is there a specified limit?
|
||||||
auto limit = 0;
|
unsigned int limit = 0;
|
||||||
if (args.size () == 2)
|
if (args.size () == 2)
|
||||||
limit = strtol (args[1].c_str (), NULL, 10);
|
limit = strtol (args[1].c_str (), NULL, 10);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue