Skip to content

Commit

Permalink
feat(ux): ✨ add tgl help command (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNZL committed Jun 24, 2023
1 parent d376738 commit 2101067
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class Settings
internal const string ReportsCommand = "reports";
internal const string BrowserCommand = "browser";
internal const string RefreshCommand = "refresh";
internal const string HelpCommand = "help";
internal static readonly string[] Commands = new string[] {
StartCommand,
StopCommand,
Expand All @@ -26,6 +27,7 @@ public class Settings
ReportsCommand,
BrowserCommand,
RefreshCommand,
HelpCommand,
};

internal const string EditProjectFlag = "-p";
Expand Down
13 changes: 13 additions & 0 deletions src/TogglTrack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,19 @@ internal async ValueTask<List<Result>> GetDefaultHotKeys(bool prefetch = false)
},
},
new Result
{
Title = Settings.HelpCommand,
SubTitle = "Read plugin documentation",
IcoPath = "tip.png",
AutoCompleteText = $"{this._context.CurrentPluginMetadata.ActionKeyword} {Settings.HelpCommand} ",
Score = 75,
Action = c =>
{
this._context.API.OpenUrl(new Uri(@"https://github.com/JamesNZL/flow-toggl-plugin/blob/main/README.md"));
return true;
},
},
new Result
{
Title = Settings.RefreshCommand,
SubTitle = "Refresh plugin cache",
Expand Down

0 comments on commit 2101067

Please sign in to comment.