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

add command to list all commands unformated #30

Open
bnomei opened this issue Dec 21, 2022 · 2 comments
Open

add command to list all commands unformated #30

bnomei opened this issue Dec 21, 2022 · 2 comments

Comments

@bnomei
Copy link

bnomei commented Dec 21, 2022

not like in help but just one item per line. why?

that can be used in further automations like fig.

CleanShot 2022-12-21 at 10 57 53@2x

@bnomei
Copy link
Author

bnomei commented Dec 21, 2022

if you want to go deeper down the rabbit hole you could also create an publish a script to take care of that.
https://fig.io/docs/getting-started

sadly there is no parser for PHP available yet so its manual work.

@bnomei
Copy link
Author

bnomei commented Dec 21, 2022

i created one myself kirby make:command commands --global

<?php

declare(strict_types = 1);

use Kirby\CLI\CLI;

return [
	'description' => 'All commands',
	'command' => static function (CLI $cli): void {
		$commands = $cli->commands();

		foreach ($commands['core'] as $command) {
			$cli->out($command);
		}

		if (count($commands['global']) > 0) {
			foreach ($commands['global'] as $command) {
				$cli->out($command);
			}
		}

		if (count($commands['custom']) > 0) {
			foreach ($commands['custom'] as $command) {
				$cli->out($command);
			}
		}

		if (count($commands['plugins']) > 0) {
			foreach ($commands['plugins'] as $command) {
				$cli->out($command);
			}
		}
	}
];

but it would be nice to have this out-of-the-box

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant