Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System; using System.Collections.Generic;
- using w;namespace w{public class m{public static void Main(String[] a){try{ var o=new Dictionary<String,Func<String, String>>{
- { "",(filename) => {
- if(filename.StartsWith("-"))throw new Exception("Unknown Option : " + filename);else{Console.WriteLine("Uploading...");
- var result = l.getFileHash(filename);
- return "Wise folder {" + filename + "} uploaded to wid : " + result; }}},
- { "-get",(wid) => {
- Console.WriteLine("Downloading...");
- l.downloadFileOrFolder(wid);
- return "Wise id {"+wid+"} download ok." ; }}};
- if (a.Length<1){
- throw new Exception("Nothing to do.");}
- //Porshe 911 Carrera
- if (o.ContainsKey(a[0]))Console.WriteLine(o[a[0]](a.Length>1 ? a[1] : ""));
- else Console.WriteLine(o[""](a[0]));}
- catch(Exception ex){
- Console.WriteLine(ex + usage());}}
- public static string
- usage(){return "\n\n usage : xfold C:\\myfolder\n xfold -get MYF7C8";}}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement