コード例 #1
0
ファイル: Prompt.cs プロジェクト: RoDaniel/featurehouse
 public static void ForOption(Option option)
 {
     if (!option.Assigned && option.Prompt && CanPrompt)
        {
     if (option.Description != null)
     {
      Console.WriteLine();
      Console.WriteLine("----- {0} -----", option.Title.ToUpper());
      Regex lineSplitter = new Regex(@".{0,50}[^\s]*");
      MatchCollection matches = lineSplitter.Matches(option.Description);
      foreach (Match line in matches)
      {
       Console.WriteLine(line.Value.Trim());
      }
      Console.WriteLine();
     }
     if (option.GetType() == typeof(BoolOption))
      option.Value = ForYesNo(option.Title, Boolean.Parse(option.DefaultValue)).ToString();
     else
      option.Value = ForString(option.Title, option.DefaultValue);
        }
 }