Skip to content

Commit

Permalink
Added fusion:listprototypes command
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximilian Schmidt committed Aug 21, 2019
1 parent 41778e1 commit 5efa58f
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
23 changes: 23 additions & 0 deletions Classes/Command/FusionCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,29 @@ public function debugPrototypeCommand(string $prototype, bool $noColor = false,
$this->newline();
}

/**
* List all known prototypes by their names.
*
* List all known prototypes by their names.
*
* @return void
*/
public function listPrototypesCommand(bool $noFormat = false)
{
$prototypeNames = \array_keys($this->debugger->loadAllDefinitions(true));

if ($noFormat === false) {
\natsort($prototypeNames);

$this->outputUnorderedList($prototypeNames);
$this->quit(0);
}

foreach ($prototypeNames as $name) {
$this->outputLine($name);
}
}

// Service methods

/**
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

A small plugin for the awesome Neos CMS, to improve debugging of Fusion DSL code.

-------

**PLEASE NOTE! This plugin is currently work in progress and alls of it's parts are subject to change probably! You should not rely on this in a production environment yet as it is not proven to be stable!**

-------
Expand All @@ -19,6 +17,7 @@ A small plugin for the awesome Neos CMS, to improve debugging of Fusion DSL code
- [`fusion:debugprototype`](#fusiondebugprototype)
- [`fusion:showobjecttree`](#fusionshowobjecttree)
- [`fusion:lint`](#fusionlint)
- [`fusion:listprototypes`](#fusionlistprototypes)
- [Configuration](#configuration)
- [`fusionFilePathPatterns`](#fusionfilepathpatterns)
- [`namespaceMap`](#namespacemap)
Expand Down Expand Up @@ -95,6 +94,13 @@ You can optionally provide a dot-separated path that will be loaded instead of t
Checks all Fusion files individually for syntax errors and lists the incorrect files with their associated package and file path.
This command was intended to programmatically check the correctness of the Fusion source code and is in fact still an experiment but listed for the sake of completeness.

#### `fusion:listprototypes`

> `mcstreetguy.fusiondebugger:fusion:listprototypes [--no-format]`
Lists all known Fusion prototype names.
If the `--no-format` option is specified, the list will lack any bullets and return unsorted.

### Configuration

The plugin comes with minimal configuration options available. These are listed below for reference.
Expand Down
3 changes: 2 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
| 0.2-alpha | :x: |
| 0.3-alpha | :x: |
| 0.4-alpha | :x: |
| 0.5-alpha | :white_check_mark: |
| 0.5-alpha | :x: |
| 0.6-alpha | :white_check_mark: |
| dev-master | :white_check_mark: |

## Reporting a Vulnerability
Expand Down
4 changes: 2 additions & 2 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- [x] Add color highlighting for tree views
- [x] Filter empty values by default
- [x] Sort all keys by their @position property
- [ ] Add a backend module with a collapsible tree structure
- [x] Add a progress bar to the lint command in non-verbose mode
- [ ] Add handling for nested prototype definitions (or at least style them in some proper way)
- [ ] Add a backend module with a collapsible tree structure
- [ ] Add handling for nested prototype definitions (or at least style them in some proper way)

0 comments on commit 5efa58f

Please sign in to comment.