CmdX: Added error message when expected ids are missing

This commit is contained in:
Paul Beckingham 2016-07-17 08:55:18 -04:00
parent 1e8709e0dc
commit bd7f3d5015
7 changed files with 19 additions and 1 deletions

View file

@ -87,7 +87,7 @@ int CmdJoin (
}
}
else
std::cout << "Provide two interval IDs to join them.\n";
throw std::string ("Two IDs must be specified. See 'timew help join'.");
return 0;
}

View file

@ -50,6 +50,9 @@ int CmdLengthen (
delta = arg.attribute ("raw");
}
if (! ids.size ())
throw std::string ("IDs must be specified. See 'timew help lengthen'.");
// TODO Support :adjust
// Load the data.

View file

@ -55,6 +55,9 @@ int CmdMove (
new_start = arg.attribute ("raw");
}
if (! id)
throw std::string ("ID must be specified. See 'timew help move'.");
// TODO Support :adjust
// Load the data.

View file

@ -50,6 +50,9 @@ int CmdShorten (
delta = arg.attribute ("raw");
}
if (! ids.size ())
throw std::string ("IDs must be specified. See 'timew help shorten'.");
// TODO Support :adjust
// Load the data.

View file

@ -50,6 +50,9 @@ int CmdSplit (
delta = arg.attribute ("raw");
}
if (! ids.size ())
throw std::string ("IDs must be specified. See 'timew help split'.");
// TODO Support :adjust
// Load the data.

View file

@ -48,6 +48,9 @@ int CmdTag (
tags.push_back (arg.attribute ("raw"));
}
if (! ids.size ())
throw std::string ("IDs must be specified. See 'timew help tag'.");
// Load the data.
// Note: There is no filter.
Interval filter;

View file

@ -48,6 +48,9 @@ int CmdUntag (
tags.push_back (arg.attribute ("raw"));
}
if (! ids.size ())
throw std::string ("IDs must be specified. See 'timew help untag'.");
// Load the data.
// Note: There is no filter.
Interval filter;