Skip to content

Commit 570ff8b

Browse files
committed
Use textarea for command description and add xml files for the di.xml settings
1 parent ef47c50 commit 570ff8b

File tree

6 files changed

+63
-13
lines changed

6 files changed

+63
-13
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#if (${CLI_COMMAND_NAME})
2+
<type name="Magento\Framework\Console\CommandListInterface">
3+
#end
4+
<arguments>
5+
<argument name="commands" xsi:type="array">
6+
<item name="${CLI_COMMAND_DI_NAME}" xsi:type="object">${CLI_COMMAND_CLASS}</item>
7+
</argument>
8+
</arguments>
9+
#if (${CLI_COMMAND_NAME})
10+
</type>
11+
#end
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!--
2+
/*
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<html>
8+
<body>
9+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
10+
<tr>
11+
<td>
12+
<font face="verdana" size="-1">
13+
Each CLI Command must be register in the related module di.xml.
14+
Declare your Command class in Magento\Framework\Console\CommandListInterface and configure the command name using dependency injection
15+
</font>
16+
</td>
17+
</tr>
18+
<tr>
19+
<td>
20+
<font face="verdana" size="-1">
21+
<a href="https://devdocs.magento.com/guides/v2.3/extension-dev-guide/cli-cmds/cli-howto.html">Create a new CLI Command in Magento.</a>
22+
</font>
23+
</td>
24+
</tr>
25+
</table>
26+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
27+
<tr>
28+
<td colspan="3"><font face="verdana" size="-1">Predefined variables explanation:</font></td>
29+
</tr>
30+
<tr>
31+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${CLI_COMMAND_DI_NAME}</b></font></nobr></td>
32+
<td width="10">&nbsp;</td>
33+
<td width="100%" valign="top"><font face="verdana" size="-1">A CLI Command name used for DI to the CommandListInterface.</font></td>
34+
</tr>
35+
<tr>
36+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${CLI_COMMAND_CLASS}</b></font></nobr></td>
37+
<td width="10">&nbsp;</td>
38+
<td width="100%" valign="top"><font face="verdana" size="-1">A class of the CLI Command.</font></td>
39+
</tr>
40+
</table>
41+
</body>
42+
</html>

resources/fileTemplates/internal/Magento CLI Command Class.php.ft

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
#parse("PHP File Header.php")
33

44
#if (${NAMESPACE})
5-
65
namespace ${NAMESPACE};
7-
86
#end
97

108
use Symfony\Component\Console\Command\Command;

src/com/magento/idea/magento2plugin/actions/generation/NewCronjobAction.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import com.intellij.psi.PsiDirectory;
1111
import com.magento.idea.magento2plugin.MagentoIcons;
1212
import com.magento.idea.magento2plugin.actions.generation.dialog.NewCronjobDialog;
13-
import com.magento.idea.magento2plugin.indexes.CronGroupIndex;
1413
import org.jetbrains.annotations.NotNull;
1514

1615
public class NewCronjobAction extends AnAction {

src/com/magento/idea/magento2plugin/actions/generation/dialog/NewCLICommandDialog.form

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,6 @@
4949
<text value=""/>
5050
</properties>
5151
</component>
52-
<component id="9e289" class="javax.swing.JTextField" binding="cliCommandDescriptionField">
53-
<constraints>
54-
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
55-
<preferred-size width="150" height="-1"/>
56-
</grid>
57-
</constraints>
58-
<properties/>
59-
</component>
6052
<component id="86880" class="javax.swing.JLabel">
6153
<constraints>
6254
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
@@ -89,7 +81,7 @@
8981
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
9082
</constraints>
9183
<properties>
92-
<labelFor value="9e289"/>
84+
<labelFor value="d786e"/>
9385
<text resource-bundle="magento2/common" key="common.cli.cli.description"/>
9486
</properties>
9587
</component>
@@ -129,6 +121,14 @@
129121
</component>
130122
</children>
131123
</grid>
124+
<component id="d786e" class="javax.swing.JTextArea" binding="cliCommandDescriptionField">
125+
<constraints>
126+
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false">
127+
<preferred-size width="150" height="50"/>
128+
</grid>
129+
</constraints>
130+
<properties/>
131+
</component>
132132
</children>
133133
</grid>
134134
</children>

src/com/magento/idea/magento2plugin/actions/generation/dialog/NewCLICommandDialog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class NewCLICommandDialog extends AbstractDialog {
2121
private JTextField cliCommandClassNameField;
2222
private JTextField cliCommandParentDirectoryField;
2323
private JTextField cliCommandNameField;
24-
private JTextField cliCommandDescriptionField;
24+
private JTextArea cliCommandDescriptionField;
2525
private JButton buttonCancel;
2626
private JButton buttonOK;
2727

0 commit comments

Comments
 (0)