Sha256: b3541201b4f8bcaeca62e102f9d225e3291f616d403acdf642d00ebdc1ee3dfe
Contents?: true
Size: 1.6 KB
Versions: 4
Compression:
Stored size: 1.6 KB
Contents
#!/usr/bin/env ruby # frozen_string_literal: true require_relative "../lib/cpflow" commands_str_arr = [] commands = Command::Base.all_commands commands.keys.sort.each do |command_key| command_class = commands[command_key] next if command_class::HIDE name = command_class::NAME usage = command_class::USAGE.empty? ? name : command_class::USAGE options = command_class::OPTIONS long_description = command_class::LONG_DESCRIPTION examples = command_class::EXAMPLES command_str = "### `#{name}`\n\n" command_str += "#{long_description.strip}\n\n" if examples.empty? options_str_arr = [] options.each do |option| next unless option[:params][:required] options_str_arr.push("#{option[:params][:aliases][0]} $#{option[:params][:banner]}") end options_str = options_str_arr.join(" ") command_str += "```sh\ncpflow #{usage}" command_str += " #{options_str}" unless options_str.empty? command_str += "\n```" else command_str += examples.strip end commands_str_arr.push(command_str) end commands_str = commands_str_arr.join("\n\n") file_path = "#{__dir__}/../docs/commands.md" file_data = <<~DATA <!-- NOTE: This file is automatically generated by running `script/generate_commands_docs`. Do NOT edit it manually. --> ## Common Options ``` -a XXX, --app XXX app ref on Control Plane (GVC) ``` This `-a` option is used in most of the commands and will pick all other app configurations from the project-specific `.controlplane/controlplane.yml` file. ## Commands #{commands_str} DATA File.binwrite(file_path, file_data)
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
cpflow-4.0.1 | script/update_command_docs |
cpflow-4.0.0 | script/update_command_docs |
cpflow-3.0.1 | script/update_command_docs |
cpflow-3.0.0 | script/update_command_docs |