if title
= title >
end
if summary
= title ? word_wrap(" #{summary}") : word_wrap(summary) >
end
> Usage: actions.each do |name, action|
action.implicit_usages.each do |usage| = " run #{usage}".rstrip end
end
if guests.any?
guests.each do |userfile| = " run #{userfile.full_name}" end > run [COMMAND] (--help | -h)
elsif full_name && !full_name.empty?
> run {{ full_name }} (--help | -h)
else
> run (--help | -h)
end
if version > run –version end >
if commands.any? || guests.any?
> Commands: commands.each do |action| = " nb`#{action.command_string}`" = word_wrap " #{action.help}" > end guests.each do |userfile| summary = userfile.summary || userfile.title || "Run nu`run #{userfile.full_name} --help` for more information" = " nb`#{userfile.name}`" = word_wrap " #{summary}" > end
end
if params.any?
> Parameters: params.each do |name, help| = " #{name}" = word_wrap " #{help}" > end
end
> Options: options.each do |name, help|
= " #{name}" = word_wrap " #{help}" >
end > –help, -h > Show this message > if version
> --version > Show version number >
end
if env_vars.any?
> Environment Variables: env_vars.each do |name, help| = " #{name}" = word_wrap " #{help}" > end
end
if shortcuts.any?
> Shortcuts: maxlen = shortcuts.keys.map(&:size).max shortcuts.each do |from, to| = " nb`#{from.ljust maxlen}` #{to}" end >
end
if examples.any?
> Examples: examples.each do |text| = word_wrap " #{text}" end >
end