public virtual void AppendUsage(IConsoleBuffer buff) { buff.AppendLine("usage:"); if (!string.IsNullOrWhiteSpace(CommandPrefix)) { buff.Append(CommandPrefix); buff.Append(" "); } buff.Append(Command); buff.Append(" "); buff.SetIndent(buff.CurrentPosition + 1); for (int i = 0; i < _pargs.Count; i++) { _pargs[i].AppendUsage(buff); buff.Append(" "); } foreach (var narg in _nargs.Values) { narg.AppendUsage(buff); buff.Append(" "); } buff.SetIndent(0); }
public virtual void AppendHelp(IConsoleBuffer buff) { buff.SetIndent(8); AppendHelpTitle(buff); buff.SetIndent(32); if (buff.CurrentPosition >= 32) { buff.AppendLine(); } buff.Append(Help); buff.SetIndent(0); }
public virtual void AppendHelp(IConsoleBuffer buff) { AppendUsage(buff); buff.AppendLine(); buff.AppendLine(); if (_pargs.Count > 0) { buff.AppendLine("positional arguments:"); buff.AppendLine(); for (int i = 0; i < _pargs.Count; i++) { _pargs[i].AppendHelp(buff); buff.AppendLine(); } } if (_nargs.Count > 0) { buff.AppendLine(); buff.AppendLine("named arguments:"); buff.AppendLine(); foreach (var narg in _nargs.Values) { narg.AppendHelp(buff); buff.AppendLine(); } } }