Skip to content

Commit

Permalink
feat(ux)!: 💥 use -T flag to change tgl stop end time (#58)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `-t` no longer works to specify the stop time with `tgl stop`, as this is the flag that is used to specify the start time with all other commands.

Instead, `-T` will take its place to specify the stop time to match the other commands.
  • Loading branch information
JamesNZL committed Jun 23, 2023
1 parent 97b4b8a commit 2363573
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/TogglTrack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ internal async ValueTask<List<Result>> RequestStopEntry(CancellationToken token,
},
};

if (!query.SearchTerms.Contains(Settings.TimeSpanFlag))
if (!query.SearchTerms.Contains(Settings.TimeSpanEndFlag))
{
if (!this._settings.ShowUsageTips)
{
Expand All @@ -1043,13 +1043,13 @@ internal async ValueTask<List<Result>> RequestStopEntry(CancellationToken token,
results.Add(new Result
{
Title = "Usage Tip",
SubTitle = $"Use {Settings.TimeSpanFlag} to specify the stop time",
SubTitle = $"Use {Settings.TimeSpanEndFlag} to specify the stop time",
IcoPath = "tip.png",
AutoCompleteText = $"{query.ActionKeyword} {query.Search} {Settings.TimeSpanFlag} ",
AutoCompleteText = $"{query.ActionKeyword} {query.Search} {Settings.TimeSpanEndFlag} ",
Score = 1,
Action = c =>
{
this._context.API.ChangeQuery($"{query.ActionKeyword} {query.Search} {Settings.TimeSpanFlag} ");
this._context.API.ChangeQuery($"{query.ActionKeyword} {query.Search} {Settings.TimeSpanEndFlag} ");
return false;
}
});
Expand All @@ -1060,7 +1060,7 @@ internal async ValueTask<List<Result>> RequestStopEntry(CancellationToken token,
try
{
var stopTimeSpan = TimeSpanParser.Parse(
Main.ExtractFromQuery(query, Array.IndexOf(query.SearchTerms, Settings.TimeSpanFlag) + 1),
Main.ExtractFromQuery(query, Array.IndexOf(query.SearchTerms, Settings.TimeSpanEndFlag) + 1),
new TimeSpanParserOptions
{
UncolonedDefault = Units.Minutes,
Expand Down Expand Up @@ -1131,7 +1131,7 @@ internal async ValueTask<List<Result>> RequestStopEntry(CancellationToken token,
results.Add(new Result
{
Title = "Usage Example",
SubTitle = $"{query.ActionKeyword} {Settings.StopCommand} {Settings.TimeSpanFlag} -5 mins",
SubTitle = $"{query.ActionKeyword} {Settings.StopCommand} {Settings.TimeSpanEndFlag} -5 mins",
IcoPath = "tip.png",
AutoCompleteText = $"{query.ActionKeyword} {query.Search} -5 mins",
Score = 100000,
Expand Down

0 comments on commit 2363573

Please sign in to comment.