Skip to content

Allow calling help info using spark --help #6383

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

Merged
merged 3 commits into from
Aug 21, 2022

Conversation

paulbalandan
Copy link
Member

@paulbalandan paulbalandan commented Aug 17, 2022

Description
Closes #6301

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@paulbalandan paulbalandan added enhancement PRs that improve existing functionalities 4.3 labels Aug 17, 2022
@paulbalandan
Copy link
Member Author

paulbalandan commented Aug 17, 2022

The PHPStan error disappears if treatPhpDocTypesAsCertain is set to true.
https://phpstan.org/r/311e2c41-f186-4be9-840e-960a5807d786


Bug reported to PHPStan.

@kenjis
Copy link
Member

kenjis commented Aug 18, 2022

The PHPStan error disappears if treatPhpDocTypesAsCertain is set to true.

What do you mean?

@paulbalandan
Copy link
Member Author

I mean here:

treatPhpDocTypesAsCertain: false

@kenjis
Copy link
Member

kenjis commented Aug 18, 2022

Ah, I see that unchecking the box results in an error. Really weird.
Screenshot 2022-08-18 15 57 32

@kenjis
Copy link
Member

kenjis commented Aug 18, 2022

Is this intended? It seems to me a bit strange.

$ php spark --help

CodeIgniter v4.2.4 Command Line Tool - Server Time: 2022-08-18 02:43:16 UTC-05:00

Usage:
  list

Description:
  Lists the available commands.

Options:
  --simple  Prints a list of the commands with no other info

@kenjis
Copy link
Member

kenjis commented Aug 18, 2022

What should we do about this?

$ php spark help make:command --help

CodeIgniter v4.2.4 Command Line Tool - Server Time: 2022-08-18 02:54:58 UTC-05:00

Usage:
  help command_name

Description:
  Displays basic usage information.

Arguments:
  command_name  The command name [default: "help"]

@paulbalandan
Copy link
Member Author

Is this intended? It seems to me a bit strange.

Yes, as stated in the test. Also checking with others, like in composer. Running composer --help:

composer --help
Description:
  List commands

Usage:
  list [options] [--] [<namespace>]

Arguments:
  namespace                      The namespace name

Options:
      --raw                      To output raw command list
      --format=FORMAT            The output format (txt, xml, json, or md) [default: "txt"]
      --short                    To skip describing commands' arguments
  -h, --help                     Display help for the given command. When no command is given display help for the list command
  -q, --quiet                    Do not output any message
  -V, --version                  Display this application version
      --ansi|--no-ansi           Force (or disable --no-ansi) ANSI output
  -n, --no-interaction           Do not ask any interactive question
      --profile                  Display timing and memory usage information
      --no-plugins               Whether to disable plugins.
      --no-scripts               Skips the execution of all scripts defined in composer.json file.
  -d, --working-dir=WORKING-DIR  If specified, use the given directory as working directory.
      --no-cache                 Prevent use of the cache
  -v|vv|vvv, --verbose           Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug        

Help:
  The list command lists all commands:

    C:\ProgramData\ComposerSetup\bin\composer.phar list

  You can also display the commands for a specific namespace:

    C:\ProgramData\ComposerSetup\bin\composer.phar list test

  You can also output the information in other formats by using the --format option:

    C:\ProgramData\ComposerSetup\bin\composer.phar list --format=xml

  It's also possible to get raw list of commands (useful for embedding command runner):

    C:\ProgramData\ComposerSetup\bin\composer.phar list --raw

What should we do about this?

Let me check this

@paulbalandan
Copy link
Member Author

What should we do about this?

$ php spark help make:command --help

CodeIgniter v4.2.4 Command Line Tool - Server Time: 2022-08-18 02:54:58 UTC-05:00

Usage:
  help command_name

Description:
  Displays basic usage information.

Arguments:
  command_name  The command name [default: "help"]

Funny. Seems Symfony Console behaves the same. Running composer help status --help:

composer help status --help
Description:
  Display help for a command

Usage:
  help [options] [--] [<command_name>]

Arguments:
  command_name                   The command name [default: "help"]

Options:
      --format=FORMAT            The output format (txt, xml, json, or md) [default: "txt"]
      --raw                      To output raw command help
  -h, --help                     Display help for the given command. When no command is given display help for the list command
  -q, --quiet                    Do not output any message
  -V, --version                  Display this application version
      --ansi|--no-ansi           Force (or disable --no-ansi) ANSI output
  -n, --no-interaction           Do not ask any interactive question
      --profile                  Display timing and memory usage information
      --no-plugins               Whether to disable plugins.
      --no-scripts               Skips the execution of all scripts defined in composer.json file.
  -d, --working-dir=WORKING-DIR  If specified, use the given directory as working directory.
      --no-cache                 Prevent use of the cache
  -v|vv|vvv, --verbose           Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug        

Help:
  The help command displays help for a given command:

    C:\ProgramData\ComposerSetup\bin\composer.phar help list

  You can also output the help in other formats by using the --format option:

    C:\ProgramData\ComposerSetup\bin\composer.phar help --format=xml list

  To display the list of available commands, please use the list command.

@kenjis
Copy link
Member

kenjis commented Aug 18, 2022

We don't need to make the same as Symfony's funny behavior, but there will be no particular problem.

@paulbalandan
Copy link
Member Author

The similarity was just coincidental. I'm trying with git but git help pull --help does not work.

@kenjis kenjis merged commit 9181a86 into codeigniter4:4.3 Aug 21, 2022
@paulbalandan paulbalandan deleted the spark-help-option branch August 21, 2022 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement PRs that improve existing functionalities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants