Skip to content

Commit

Permalink
Merge pull request #56 from pjf/tidy
Browse files Browse the repository at this point in the history
Display help when called with no options.
  • Loading branch information
pjf committed Oct 12, 2014
2 parents 6ec676c + 3129bb3 commit 06307a1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions CKAN/CKAN/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@ public static int Main (string[] args) {

Options cmdline;

// If called with no arguments, the parser throws an exception.
// TODO: It would be nice if we just *displayed* the help here,
// rather than asking the user to try --help.

try {
cmdline = new Options (args);
}
catch (NullReferenceException) {
Console.WriteLine ("Try ckan --help");
// Oops, something went wrong. Generate the help screen instead!

string[] help = { "--help" }; // Is there a nicer way than a temp var?
new Options ( help );
return EXIT_BADOPT;
}

Expand Down

0 comments on commit 06307a1

Please sign in to comment.