using System;
using System.Linq;

namespace isn
{
   
    partial class Program
    {
        private static void SetDefaultSource(string arg)
        {
            SourceSettings settings = 
            Settings.Sources.ContainsKey(arg) ?
            Settings.Sources[arg] :
            Settings.Sources.Values.FirstOrDefault((s)=> s.Alias == arg) ;
            if (settings==null) throw new InvalidOperationException(arg);
            Settings.DefaultSourceKey = arg;
            SaveConfig();
        }
        
    }
}