-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathPricingCmd.cs
26 lines (23 loc) · 1.35 KB
/
PricingCmd.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using Petabridge.Cmd;
namespace Akka.CQRS.Pricing.Cli
{
/// <summary>
/// Defines all of the Petabridge.Cmd commands for tracking the price.
/// </summary>
public static class PricingCmd
{
public static readonly CommandDefinition TrackPrice = new CommandDefinitionBuilder()
.WithName("track").WithDescription("Track the live changes in price for a given ticker symbol continuously. Press Control + C to exit.")
.WithArgument(b => b.IsMandatory(true).WithName("symbol").WithSwitch("-s").WithSwitch("-S").WithSwitch("--symbol")
.WithDefaultValues(AvailableTickerSymbols.Symbols)
.WithDescription("The ticker symbol for the stock."))
.Build();
public static readonly CommandDefinition PriceHistory = new CommandDefinitionBuilder()
.WithName("history").WithDescription("Get the historical price history for the specified ticker symbol")
.WithArgument(b => b.IsMandatory(true).WithName("symbol").WithSwitch("-s").WithSwitch("-S").WithSwitch("--symbol")
.WithDefaultValues(AvailableTickerSymbols.Symbols)
.WithDescription("The ticker symbol for the stock."))
.Build();
public static readonly CommandPalette PricingCommandPalette = new CommandPalette("price", new []{ TrackPrice, PriceHistory });
}
}