Preliminary checklist
Expected Behavior
When executing the command with the -h --help flags:
ddev symlink-project -h
ddev symlink-project --help
The command should display help information including:
- Command description
- Usage syntax
- Available flags and their descriptions
- Usage examples.
Actual Behavior
Help information is not displayed. Instead, the command executes the symlink operation as if no flags were provided.
Steps To Reproduce
Execute the following command:
ddev symlink-project -h
or
ddev symlink-project --help
Anything else?
Problem 1
When executing the commands:
ddev symlink-project -h
ddev symlink-project --help
Help information is not displayed; instead, the command executes.
Problem 2
The documentation states:
Usage: symlink-project [flags] [args]
However, symlink_project.php is called without arguments.
To pass arguments properly, the "symlink-project" script should use:
php symlink_project.php "$@"
instead of:
php symlink_project.php
Problem 3
Even if we allow argument passing by using php symlink_project.php "$@" in the "symlink-project" script, the symlink_project.php script only accepts these flags:
-v --verbose
-c --copy
See: https://git.drupalcode.org/project/gitlab_templates/-/blob/main/scripts/symlink_project.php
Therefore, running:
ddev symlink-project -h
ddev symlink-project --help
would not display help information. Instead, we'd get the error message:
"Positional parameters are no longer used."
Problem 4
When executing the command with the -v --verbose flag, the output provides no more useful information than calling the command without the flag. This makes the flag pointless.
Proposed Solutions
Option 1
- Remove arguments and flags from the "Usage" section:
## Usage: symlink-project
## Example: "ddev symlink-project"
- To enable -h --help flag support, add this code at the beginning of the "symlink-project" script:
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo "Description: Symlink project files into the configured location"
echo "Usage: symlink-project"
exit 0
fi
Option 2
- If the "Copy the project files instead of making symlinks" mode has a real use case, document the -c --copy flag in the "symlink-project" script like this:
## Usage: symlink-project [flags]
## Flags: -c/--copy (copy instead of symlink)
## Example: "ddev symlink-project" or "ddev symlink-project --copy"
- To enable -h --help flag support, add this code at the beginning of the "symlink-project" script:
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo "Description: Symlink project files into the configured location"
echo "Usage: symlink-project [flags]"
echo "Flags:"
echo " -c, --copy Copy files instead of symlinking"
exit 0
fi
- To enable calling the "symlink-project" command with the -c, --copy flag, the "symlink-project" script should pass arguments to "symlink_project.php". Therefore, replace this line of code:
php symlink_project.php
with:
php symlink_project.php "$@"
Preliminary checklist
Expected Behavior
When executing the command with the -h --help flags:
ddev symlink-project -hddev symlink-project --helpThe command should display help information including:
Actual Behavior
Help information is not displayed. Instead, the command executes the symlink operation as if no flags were provided.
Steps To Reproduce
Execute the following command:
ddev symlink-project -hor
ddev symlink-project --helpAnything else?
Problem 1
When executing the commands:
ddev symlink-project -h
ddev symlink-project --help
Help information is not displayed; instead, the command executes.
Problem 2
The documentation states:
Usage: symlink-project [flags] [args]
However, symlink_project.php is called without arguments.
To pass arguments properly, the "symlink-project" script should use:
php symlink_project.php "$@"
instead of:
php symlink_project.php
Problem 3
Even if we allow argument passing by using php symlink_project.php "$@" in the "symlink-project" script, the symlink_project.php script only accepts these flags:
-v --verbose
-c --copy
See: https://git.drupalcode.org/project/gitlab_templates/-/blob/main/scripts/symlink_project.php
Therefore, running:
ddev symlink-project -h
ddev symlink-project --help
would not display help information. Instead, we'd get the error message:
"Positional parameters are no longer used."
Problem 4
When executing the command with the -v --verbose flag, the output provides no more useful information than calling the command without the flag. This makes the flag pointless.
Proposed Solutions
Option 1
Option 2
php symlink_project.phpwith:
php symlink_project.php "$@"