Example #1
0
        public static Command Download(
            Uri url,
            string destination  = null,
            WgetOptions options = WgetOptions.None,
            bool sudo           = false)
        {
            var sb = new StringBuilder("wget ");

            if (options.HasFlag(WgetOptions.Verbose))
            {
                sb.Append("-v ");
            }

            sb.Append('"');
            sb.Append(url.ToString());
            sb.Append('"');

            if (destination != null)
            {
                sb.Append(" -O ");
                sb.Append(destination);
            }

            return(new Command(sb.ToString(), sudo));
        }
Example #2
0
 public static Command Download(
     string url,
     string destination  = null,
     WgetOptions options = WgetOptions.None,
     bool sudo           = false)
 {
     return(Download(new Uri(url), destination, options, sudo));
 }