Exemplo n.º 1
0
        protected internal override void ProcessOptions(List <string> args)
        {
            CommandFormat cf = new CommandFormat(1, int.MaxValue, "p");

            cf.Parse(args);
            createParents = cf.GetOpt("p");
        }
Exemplo n.º 2
0
        // milliseconds
        /// <exception cref="System.IO.IOException"/>
        protected internal override void ProcessOptions(List <string> args)
        {
            CommandFormat cf = new CommandFormat(1, 1, "f");

            cf.Parse(args);
            follow = cf.GetOpt("f");
        }
Exemplo n.º 3
0
        protected internal override void ProcessOptions(List <string> args)
        {
            CommandFormat cf = new CommandFormat(1, 1, "e", "d", "f", "s", "z");

            cf.Parse(args);
            string[] opts = Collections.ToArray(cf.GetOpts(), new string[0]);
            switch (opts.Length)
            {
            case 0:
            {
                throw new ArgumentException("No test flag given");
            }

            case 1:
            {
                flag = opts[0][0];
                break;
            }

            default:
            {
                throw new ArgumentException("Only one test flag is allowed");
            }
            }
        }
Exemplo n.º 4
0
            /// <exception cref="System.IO.IOException"/>
            protected internal override void ProcessOptions(List <string> args)
            {
                CommandFormat cf = new CommandFormat(2, int.MaxValue);

                cf.Parse(args);
                GetRemoteDestination(args);
            }
Exemplo n.º 5
0
            /// <exception cref="System.IO.IOException"/>
            protected internal override void ProcessOptions(List <string> args)
            {
                CommandFormat cf = new CommandFormat(1, int.MaxValue, "-ignore-fail-on-non-empty"
                                                     );

                cf.Parse(args);
                ignoreNonEmpty = cf.GetOpt("-ignore-fail-on-non-empty");
            }
Exemplo n.º 6
0
            /// <exception cref="System.IO.IOException"/>
            protected internal override void ProcessOptions(List <string> args)
            {
                CommandFormat cf = new CommandFormat(1, int.MaxValue, "f", "r", "R", "skipTrash");

                cf.Parse(args);
                ignoreFNF  = cf.GetOpt("f");
                deleteDirs = cf.GetOpt("r") || cf.GetOpt("R");
                skipTrash  = cf.GetOpt("skipTrash");
            }
Exemplo n.º 7
0
            /// <exception cref="System.IO.IOException"/>
            protected internal override void ProcessOptions(List <string> args)
            {
                CommandFormat cf = new CommandFormat(0, int.MaxValue, "h");

                cf.Parse(args);
                humanReadable = cf.GetOpt("h");
                if (args.IsEmpty())
                {
                    args.AddItem(Path.Separator);
                }
            }
Exemplo n.º 8
0
            /// <exception cref="System.IO.IOException"/>
            protected internal override void ProcessOptions(List <string> args)
            {
                CommandFormat cf = new CommandFormat(1, int.MaxValue, "crc", "ignoreCrc", "p");

                cf.Parse(args);
                SetWriteChecksum(cf.GetOpt("crc"));
                SetVerifyChecksum(!cf.GetOpt("ignoreCrc"));
                SetPreserve(cf.GetOpt("p"));
                SetRecursive(true);
                GetLocalDestination(args);
            }
Exemplo n.º 9
0
            /// <exception cref="System.IO.IOException"/>
            protected internal override void ProcessOptions(List <string> args)
            {
                PopPreserveOption(args);
                CommandFormat cf = new CommandFormat(2, int.MaxValue, "f");

                cf.Parse(args);
                SetOverwrite(cf.GetOpt("f"));
                // should have a -r option
                SetRecursive(true);
                GetRemoteDestination(args);
            }
Exemplo n.º 10
0
        // default format string
        /// <exception cref="System.IO.IOException"/>
        protected internal override void ProcessOptions(List <string> args)
        {
            CommandFormat cf = new CommandFormat(1, int.MaxValue, "R");

            cf.Parse(args);
            SetRecursive(cf.GetOpt("R"));
            if (args.GetFirst().Contains("%"))
            {
                format = args.RemoveFirst();
            }
            cf.Parse(args);
        }
Exemplo n.º 11
0
        protected internal override void ProcessOptions(List <string> args)
        {
            CommandFormat cf = new CommandFormat(1, int.MaxValue, OptionQuota, OptionHuman);

            cf.Parse(args);
            if (args.IsEmpty())
            {
                // default path is the current working directory
                args.AddItem(".");
            }
            showQuotas    = cf.GetOpt(OptionQuota);
            humanReadable = cf.GetOpt(OptionHuman);
        }
Exemplo n.º 12
0
        /// <exception cref="System.IO.IOException"/>
        protected internal override void ProcessOptions(List <string> args)
        {
            CommandFormat cf = new CommandFormat(0, int.MaxValue, "d", "h", "R");

            cf.Parse(args);
            dirRecurse = !cf.GetOpt("d");
            SetRecursive(cf.GetOpt("R") && dirRecurse);
            humanReadable = cf.GetOpt("h");
            if (args.IsEmpty())
            {
                args.AddItem(Path.CurDir);
            }
        }
Exemplo n.º 13
0
            /// <exception cref="System.IO.IOException"/>
            protected internal override void ProcessOptions(List <string> args)
            {
                CommandFormat cf = new CommandFormat(0, int.MaxValue, "R");

                cf.Parse(args);
                SetRecursive(cf.GetOpt("R"));
                if (args.IsEmpty())
                {
                    throw new HadoopIllegalArgumentException("<path> is missing");
                }
                if (args.Count > 1)
                {
                    throw new HadoopIllegalArgumentException("Too many arguments");
                }
            }
Exemplo n.º 14
0
 /// <exception cref="System.IO.IOException"/>
 protected internal override void ProcessOptions(List <string> args)
 {
     try
     {
         CommandFormat cf = new CommandFormat(2, int.MaxValue, "nl");
         cf.Parse(args);
         delimiter = cf.GetOpt("nl") ? "\n" : null;
         dst       = new PathData(new URI(args.RemoveLast()), GetConf());
         if (dst.exists && dst.stat.IsDirectory())
         {
             throw new PathIsDirectoryException(dst.ToString());
         }
         srcs = new List <PathData>();
     }
     catch (URISyntaxException e)
     {
         throw new IOException("unexpected URISyntaxException", e);
     }
 }
Exemplo n.º 15
0
        /// <exception cref="System.IO.IOException"/>
        protected internal override void ProcessOptions(List <string> args)
        {
            CommandFormat cf = new CommandFormat(2, int.MaxValue, "R", "w");

            cf.Parse(args);
            waitOpt = cf.GetOpt("w");
            SetRecursive(true);
            try
            {
                newRep = short.ParseShort(args.RemoveFirst());
            }
            catch (FormatException nfe)
            {
                DisplayWarning("Illegal replication, a positive integer expected");
                throw;
            }
            if (newRep < 1)
            {
                throw new ArgumentException("replication must be >= 1");
            }
        }
Exemplo n.º 16
0
            // TODO: should probably allow path arguments for the filesystems
            /// <exception cref="System.IO.IOException"/>
            protected internal override void ProcessOptions(List <string> args)
            {
                CommandFormat cf = new CommandFormat(0, 0);

                cf.Parse(args);
            }