Esempio n. 1
0
        internal string Usage(bool inCLI = false, bool onlyCommandline = false)
        {
            StringBuilder Expression = new StringBuilder(UsageExpression.Prefix);

            if (!inCLI)
            {
                Expression.Append($"{Constants.AssemblyFile} ");
            }

            Expression.Append(Name);

            if (SupportedModes.Count() > 1)
            {
                Expression.Append($" {SupportedModes.Select(p => p.Name).BarDelimited().InBrackets()}");
            }

            if (onlyCommandline)
            {
                return(Expression.ToString());
            }

            Expression.Append(UsageDetail());
            Expression.AppendLine();
            return(Expression.ToString());
        }
Esempio n. 2
0
        internal string UsageDetail()
        {
            StringBuilder Expression = new StringBuilder($"\r\n{Description}");

            if (HasDefaultMode)
            {
                Expression.Append($"{Samples.Mode}\r\n{UsageExpression.AvailableModes}:");
                SupportedModes.ForEach(p => Expression.Append(p.ShowDescription(SupportedModes.Select(q => q.Name).GetPadding())));
            }

            return(Expression.ToString());
        }