Skip to content
Permalink
Browse files

Fixed commandline argument parsing and showing framework in banner

  • Loading branch information...
Michal Altair Valášek
Michal Altair Valášek committed Mar 17, 2019
1 parent 3c474b2 commit 7a4423196b493eeb5dc49c30d6f8009d7b29e104
Showing with 17 additions and 7 deletions.
  1. +9 −4 Altairis.Xml4web.AzureSync/Program.cs
  2. +8 −3 Altairis.Xml4web.Compiler/Program.cs
@@ -10,6 +10,12 @@ namespace Altairis.Xml4web.AzureSync {
class Program {
public const int ERRORLEVEL_SUCCESS = 0;
public const int ERRORLEVEL_FAILURE = 1;

#if NET47
private const string FX_NAME = "NetFX";
#elif NETCOREAPP
private const string FX_NAME = "CoreCLR";
#endif
private const string WEB_CONTAINER_NAME = "$web";
private const string SYS_CONTAINER_NAME = "xml4web";
private const string STORAGE_INDEX_NAME = "storage-index.json";
@@ -29,9 +35,8 @@ class Program {
static void Main(string[] args) {
var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
Console.WriteLine();

Console.WriteLine($@"o o o o o o o o XML4web Azure Site Sync Tool");
Console.WriteLine($@" \ / |\ /| | | | | Version {version}");
Console.WriteLine($@" \ / |\ /| | | | | Version {version}/{FX_NAME}");
Console.WriteLine($@" O | O | | o--O o o o o-o O-o Copyright (c) 2018-2019");
Console.WriteLine($@" / \ | | | | \ / \ / |-' | | Michal A. Valášek - Altairis");
Console.WriteLine($@"o o o o O---o o o o o-o o-o www.xml4web.com | www.rider.cz");
@@ -126,12 +131,12 @@ class Program {

private static void LoadConfiguration(string[] args) {
// Validate/load arguments
if (args.Length != 2) {
if (args.Length != 1) {
Console.WriteLine("USAGE: x4w-azsync jobname.json");
Environment.Exit(ERRORLEVEL_SUCCESS);
}

var jobConfigFileName = args[1];
var jobConfigFileName = args[0];
if (!File.Exists(jobConfigFileName)) {
Console.WriteLine($"ERROR: File '{jobConfigFileName}' was not found!");
Environment.Exit(ERRORLEVEL_FAILURE);
@@ -8,6 +8,11 @@

namespace Altairis.Xml4web.Compiler {
class Program {
#if NET47
private const string FX_NAME = "NetFX";
#elif NETCOREAPP
private const string FX_NAME = "CoreCLR";
#endif
public const int ERRORLEVEL_SUCCESS = 0;
public const int ERRORLEVEL_FAILURE = 1;

@@ -17,7 +22,7 @@ class Program {
var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
Console.WriteLine();
Console.WriteLine($@"o o o o o o o o XML4web Static Site Generator");
Console.WriteLine($@" \ / |\ /| | | | | Version {version}");
Console.WriteLine($@" \ / |\ /| | | | | Version {version}/{FX_NAME}");
Console.WriteLine($@" O | O | | o--O o o o o-o O-o Copyright (c) 2018-2019");
Console.WriteLine($@" / \ | | | | \ / \ / |-' | | Michal A. Valášek - Altairis");
Console.WriteLine($@"o o o o O---o o o o o-o o-o www.xml4web.com | www.rider.cz");
@@ -55,12 +60,12 @@ class Program {

private static void LoadConfiguration(string[] args) {
// Validate/load arguments
if (args.Length != 2) {
if (args.Length != 1) {
Console.WriteLine("USAGE: x4w-compiler buildscript.json");
Environment.Exit(ERRORLEVEL_SUCCESS);
}

var buildScriptFileName = args[1];
var buildScriptFileName = args[0];
if (!File.Exists(buildScriptFileName)) {
Console.WriteLine($"ERROR: File '{buildScriptFileName}' was not found!");
Environment.Exit(ERRORLEVEL_FAILURE);

0 comments on commit 7a44231

Please sign in to comment.
You can’t perform that action at this time.