﻿using System;

namespace Watts
{
    internal class Program
    {
        private static int Main(string[] args)
        {
            if (args.Length != 1)
            {
                Console.WriteLine("Usage: Watts.exe <\"Path/To/Config.json\">");
                return 1;
            }

            var watts = new WebApiToTypeScript.WebApiToTypeScript
            {
                ConfigFilePath = args[0]
            };

            watts.Execute();

#if DEBUG
            Console.ReadLine();
#endif

            return 0;
        }
    }
}
﻿using System;
using System.Diagnostics;
using System.IO;

namespace Watts
{
    internal class Program
    {
        private static int Main(string[] args)
        {
            var watts = new WebApiToTypeScript.WebApiToTypeScript();
            if (args.Length == 0)
            {
                var path = Path.Combine(Environment.CurrentDirectory, "watts.config.json");
                if (File.Exists(path))
                    watts.ConfigFilePath = path;
            }
            else if (args.Length > 0 && File.Exists(args[0]))
            {
                watts.ConfigFilePath = args[1];
            }

            int status = 0;
            if (watts.ConfigFilePath == null)
            {
                Console.WriteLine("Usage: Watts.exe <\"Path/To/Config.json\">");
                status = -1;
            }
            else
            {
                status = watts.Execute() ? 0 : -1;
            }

            if (Debugger.IsAttached)
            {
                Console.WriteLine("Press any key to continue . . .");
                Console.ReadLine();
            }

            return 0;
        }
    }
}
Add option to use current dir.
Add option to use current dir.
