Esempio 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");
        }
Esempio 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");
        }
Esempio 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");
            }
            }
        }
Esempio 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);
            }
Esempio 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");
            }
Esempio 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");
            }
Esempio 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);
                }
            }
Esempio 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);
            }
Esempio 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);
            }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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);
            }
        }
Esempio 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");
                }
            }
Esempio 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);
     }
 }
Esempio 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");
            }
        }
Esempio 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);
            }