Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show a link to resources docs in command help #1346

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config-defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ service:
# Optional URL to help about runtime operations.
runtime_operations_help_url: null

# Optional URL to help about managing resources.
resources_help_url: null

# Configuration relating to API calls.
# This can be overridden in the user config file.
api:
Expand Down
3 changes: 3 additions & 0 deletions src/Command/Resources/ResourcesGetCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ protected function configure()
->addOption('type', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Filter by service, app or worker type, e.g. "postgresql"');
$this->addProjectOption()->addEnvironmentOption();
Table::configureInput($this->getDefinition(), $this->tableHeader, $this->defaultColumns);
if ($this->config()->has('service.resources_help_url')) {
$this->setHelp('For more information on managing resources, see: <info>' . $this->config()->get('service.resources_help_url') . '</info>');
}
}

protected function execute(InputInterface $input, OutputInterface $output)
Expand Down
4 changes: 4 additions & 0 deletions src/Command/Resources/ResourcesSetCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ protected function configure()
'',
'If the same service and resource is specified on the command line multiple times, only the final value will be used.'
];
if ($this->config()->has('service.resources_help_url')) {
$helpLines[] = '';
$helpLines[] = 'For more information on managing resources, see: <info>' . $this->config()->get('service.resources_help_url') . '</info>';
}
$this->setHelp(implode("\n", $helpLines));

$this->addExample('Set profile sizes for two apps and a service', '--size frontend:0.1,backend:.25,database:1');
Expand Down