Skip to content

Commit

Permalink
screenshotr cli: add --version, and --help
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanmaierhofer committed Jun 21, 2022
1 parent be83f48 commit 6bcbfc3
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions src/screenshotr/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@

try
{
if (args.Contains("--version"))
{
WriteLine(Global.Version);
return;
}

if (args.Contains("--help"))
{
Usage();
return;
}

switch (args[0])
{
case "import": await Import(args.Tail()); break;
Expand All @@ -39,13 +51,18 @@

void Usage()
{
WriteLine("Usage: screenshotr <command> <args*> ");
WriteLine("import -e <endpoint> [-t <tags>] <file|folder>* [-x <exclude>] [--addRandomlabels]");
WriteLine("list -e <endpoint> [--skip <int>] [--tag <int>]");
WriteLine("tail -e <endpoint>");
WriteLine("Usage:");
WriteLine(" screenshotr --version");
WriteLine(" screenshotr --help");
WriteLine(" screenshotr <command> <args*> ");
WriteLine();
WriteLine("Commands:");
WriteLine(" import -e <endpoint> [-t <tags>] <file|folder>* [-x <exclude>] [--addRandomLabels]");
WriteLine(" list -e <endpoint> [--skip <int>] [--tag <int>]");
WriteLine(" tail -e <endpoint>");
WriteLine();
WriteLine("examples: ");
WriteLine("screenshotr import -e https://localhost:5001 -t \"mytag some-other-tag\" img.jpg /data/pictures/");
WriteLine("Examples: ");
WriteLine(" screenshotr import -e https://localhost:5001 -t \"mytag some-other-tag\" img.jpg /data/pictures/");
Environment.Exit(0);
}

Expand Down

0 comments on commit 6bcbfc3

Please sign in to comment.