Skip to content

Commit fe1c8ce

Browse files
committed
Changed HelpText to GetHelpMethod to fix issue where argument help wasn't being displayed properly.
Aligned help better.
1 parent 5addafc commit fe1c8ce

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/AppVNext.Notifier.Common/ArgumentManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ public static string NormalizeArgument(string argument)
368368

369369
public static void DisplayHelp()
370370
{
371-
WriteLine(Globals.HelpText);
371+
WriteLine(Globals.GetHelpText());
372372
}
373373
}
374374
}

src/AppVNext.Notifier.Common/Globals.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,13 @@ public static string GetDefaultIcon()
138138
$"Example: -a \"Via SMS\"{NewLine}";
139139

140140
//Help text
141-
public static readonly string HelpText =
141+
public static string GetHelpText()
142+
{
143+
return
142144
$"Create a send notifications.{NewLine}{NewLine}" +
143145
$"Usage: notifier <command>{NewLine}{NewLine}" +
144146
$"Commands:{NewLine}{NewLine}" +
145-
(IsWindowsDesktopApp ?
147+
(IsWindowsDesktopApp ?
146148
$"[-r] <appId string><appName string> Registers notifier into the Windows machine.{NewLine}" : string.Empty) +
147149
$"[-t] <title string> Title is displayed on the first line of the notification.{NewLine}" +
148150
$"[-m] <message string> Message is displayed wrapped below the title of the notification.{NewLine}" +
@@ -156,20 +158,20 @@ public static string GetDefaultIcon()
156158
$"[-d] <short|long> Determines how long to display the notification for. Default is 'short'.{NewLine}" : string.Empty) +
157159
$"[-appID] <appID string> Used to display the notification.{NewLine}" +
158160
(IsUwpApp ?
159-
$"[-i] <ID string, Text string, Place Holder Text string> Display inputs.{NewLine}" : string.Empty) +
160-
(IsUwpApp ?
161-
$"[-b] <ID string, Text string> Display buttons.{NewLine}" : string.Empty) +
162-
(IsUwpApp ?
163161
$"[-l] <image URI> URI for a picture file to be displayed with the notification.{NewLine}" : string.Empty) +
164162
$"[-n] <appID string> Returns Notifications setting status for the application. Return values: Enabled, Disabled or Unknown.{NewLine}" +
165163
$"[-k] Returns Notifications setting status for the system. Return values: Enabled or Disabled.{NewLine}" +
164+
(IsUwpApp ?
165+
$"[-b] <ID string, Text string> Display buttons.{NewLine}" : string.Empty) +
166+
(IsUwpApp ?
167+
$"[-i] <ID string, Text string,{NewLine} Place Holder Text string> Display inputs.{NewLine}" : string.Empty) +
166168
$"[-close] <ID string> Closes notification. In order to be able to close a notification,{NewLine}" +
167169
$" the parameter -w must be used to create the notification.{NewLine}" +
168170
(IsUwpApp ?
169171
$"[-a] <text string> Attribution text is displayed at the bottom of the notification.{NewLine}" : string.Empty) +
170172
$"[-v] Displays version information.{NewLine}" +
171173
$"[-?] Displays this help.{NewLine}" +
172-
$"[-help] Displays this help.{NewLine}" +
174+
$"[-help] Displays this help.{NewLine}{NewLine}" +
173175
$"Exit Codes: Failed -1, Success 0, Close 1, Dismiss 2, Timeout 3.{NewLine}{NewLine}" +
174176
$"Examples:{NewLine}{NewLine}" +
175177
$"notifier -t \"Hello World!\"{NewLine}" +
@@ -179,5 +181,6 @@ public static string GetDefaultIcon()
179181
(IsUwpApp ?
180182
$"notifier register com.appvnext.windows-notifier appvnext-windows-notifier{NewLine}" : string.Empty) +
181183
$"{NewLine}";
184+
}
182185
}
183-
}
186+
}

0 commit comments

Comments
 (0)