Skip to content

Commit 291b40b

Browse files
authored
Merge pull request #7584 from kenjis/docs-spark_commands.rst
docs: improve spark_commands.rst
2 parents 9382495 + 0abe958 commit 291b40b

1 file changed

Lines changed: 53 additions & 35 deletions

File tree

user_guide_src/source/cli/spark_commands.rst

Lines changed: 53 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ CodeIgniter ships with the official command **spark** and built-in commands.
66

77
.. contents::
88
:local:
9-
:depth: 2
9+
:depth: 3
1010

1111
****************
1212
Running Commands
@@ -16,12 +16,42 @@ Running via CLI
1616
===============
1717

1818
The commands are run from the command line, in the project root directory.
19-
The command file **spark** has been provided that is used to run any of the CLI commands::
19+
The command file **spark** has been provided that is used to run any of the CLI commands.
20+
21+
Showing List of Commands
22+
------------------------
23+
24+
When called **spark** without specifying a command, a simple help page is displayed
25+
that also provides a list of available commands and their descriptions, sorted by
26+
categories::
2027

2128
> php spark
2229

23-
When called without specifying a command, a simple help page is displayed that also provides a list of
24-
available commands.
30+
spark list
31+
^^^^^^^^^^
32+
33+
``php spark`` is the exactly same as the ``list`` command::
34+
35+
> php spark list
36+
37+
You may also use the ``--simple`` option to get a raw list of all available commands,
38+
sorted alphabetically::
39+
40+
> php spark list --simple
41+
42+
Showing Help
43+
------------
44+
45+
You can get help about any CLI command using the ``help`` command as follows::
46+
47+
> php spark help db:seed
48+
49+
Since v4.3.0, you can also use the ``--help`` option instead of the ``help`` command::
50+
51+
> php spark db:seed --help
52+
53+
Running a Command
54+
-----------------
2555

2656
You should pass the name of the command as the first argument to run that command::
2757

@@ -31,17 +61,31 @@ Some commands take additional arguments, which should be provided directly after
3161

3262
> php spark db:seed DevUserSeeder
3363

34-
You may always pass ``--no-header`` to suppress the header output, helpful for parsing results::
35-
36-
> php spark cache:clear --no-header
37-
3864
For all of the commands CodeIgniter provides, if you do not provide the required arguments, you will be prompted
3965
for the information it needs to run correctly::
4066

41-
> php spark make::controller
67+
> php spark make:controller
4268

4369
Controller class name :
4470

71+
Suppressing Header Output
72+
-------------------------
73+
74+
When you run a command, the header with CodeIgniter version and the current time
75+
is output::
76+
77+
> php spark env
78+
79+
CodeIgniter v4.3.5 Command Line Tool - Server Time: 2023-06-16 12:45:31 UTC+00:00
80+
81+
Your environment is currently set as development.
82+
83+
You may always pass ``--no-header`` to suppress the header output, helpful for parsing results::
84+
85+
> php spark env --no-header
86+
87+
Your environment is currently set as development.
88+
4589
Calling Commands
4690
================
4791

@@ -55,29 +99,3 @@ it from the command line.
5599

56100
All output from the command that is ran is captured when not run from the command line. It is returned from the command
57101
so that you can choose to display it or not.
58-
59-
******************
60-
Using Help Command
61-
******************
62-
63-
spark help
64-
==========
65-
66-
You can get help about any CLI command using the ``help`` command as follows::
67-
68-
> php spark help db:seed
69-
70-
Since v4.3.0, you can also use the ``--help`` option instead of the ``help`` command::
71-
72-
> php spark db:seed --help
73-
74-
spark list
75-
==========
76-
77-
Use the ``list`` command to get a list of available commands and their descriptions, sorted by categories::
78-
79-
> php spark list
80-
81-
You may also use the ``--simple`` option to get a raw list of all available commands, sorted alphabetically::
82-
83-
> php spark list --simple

0 commit comments

Comments
 (0)