Newer
Older
BarcodeXlsx / BarcodeXlsx / DecodeArgumentParamaters.cs
@Kunihiro Narita Kunihiro Narita on 24 Feb 2019 2 KB add verbose flag
using System;
using System.Collections.Generic;
using System.Text;

namespace BarcodeXlsx
{
    class DecodeArgumentParamaters
    {
        public string preChars;
        public string postChars;
        public string sourceFileName;
        public string destinationFileName;
        public bool enabledVerbose = false;
        public bool enabledProgress = false;

        public DecodeArgumentParamaters(string[] args)
        {
            preChars = "{";
            postChars = "}";
            enabledProgress = false;
            enabledVerbose = false;

            bool sourceFlag = false;
            bool destinationFlag = false;
            bool preCharsFlag = false;
            bool postCharsFlag = false;

            foreach (var arg in args)
            {
                if (arg == "-source")
                {
                    sourceFlag = true;
                }
                else if (arg == "-destination")
                {
                    destinationFlag = true;
                }
                else if (arg == "-prechar")
                {
                    preCharsFlag = true;
                }
                else if (arg == "-postchar")
                {
                    postCharsFlag = true;
                }
                else if (arg == "-progress")
                {
                    enabledProgress = true;
                }
                else if (arg == "-verbose")
                {
                    enabledVerbose = true;
                }
                else if (sourceFlag)
                {
                    sourceFlag = false;
                    sourceFileName = arg;
                }
                else if (destinationFlag)
                {
                    destinationFlag = false;
                    destinationFileName = arg;
                }
                else if (preCharsFlag)
                {
                    preCharsFlag = false;
                    preChars = arg;
                }
                else if (postCharsFlag)
                {
                    postCharsFlag = false;
                    postChars = arg;
                }
            }
        }
    }
}