No Code Attached Yet bug
avatar jkahrs
jkahrs
19 Jan 2024

The parser has a problem with values starting with "-" (see: symfony/symfony#27333)

Steps to reproduce the issue

Download the latest joomla release and start a script driven installtion:

wget -O joomla.zip https://downloads.joomla.org/cms/joomla5/5-0-2/Joomla_5-0-2-Stable-Full_Package.zip?format=zip
unzip joomla.zip
python3 -c "import subprocess; subprocess.run(['php', 'installation/joomla.php', 'install', '--admin-password', '-uhoh'])"

Expected result

No error regarding the value of "--admin-password" is thrown. (I know that I have omitted passing all required options to keep the example short)

Actual result

An error is thrown

$ python3 -c "import subprocess; subprocess.run(['php', 'installation/joomla.php', 'install', '--admin-password', '-uhoh'])"

                                                   
  The "--admin-password" option requires a value.  
                                                   

install [--site-name SITE-NAME] [--admin-user ADMIN-USER] [--admin-username ADMIN-USERNAME] [--admin-password ADMIN-PASSWORD] [--admin-email ADMIN-EMAIL] [--db-type DB-TYPE] [--db-host DB-HOST] [--db-user DB-USER] [--db-pass [DB-PASS]] [--db-name DB-NAME] [--db-prefix DB-PREFIX] [--db-encryption DB-ENCRYPTION] [--db-sslkey [DB-SSLKEY]] [--db-sslcert [DB-SSLCERT]] [--db-sslverifyservercert [DB-SSLVERIFYSERVERCERT]] [--db-sslca [DB-SSLCA]] [--db-sslcipher [DB-SSLCIPHER]] [--public-folder [PUBLIC-FOLDER]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [--] <command>

System information (as much as possible)

Additional comments

Maybe the installer should allow reading config values from the system environment instead of relying on the option parser

avatar jkahrs jkahrs - open - 19 Jan 2024
avatar joomla-cms-bot joomla-cms-bot - change - 19 Jan 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 19 Jan 2024
avatar jkahrs jkahrs - change - 19 Jan 2024
Title
CLI Installtion: Option parser hits symfony limitations regarding values starting with a hyphen
CLI Installation: Option parser hits symfony limitations regarding values starting with a hyphen
avatar jkahrs jkahrs - edited - 19 Jan 2024
avatar Hackwar Hackwar - change - 26 Mar 2024
Labels Added: bug
avatar Hackwar Hackwar - labeled - 26 Mar 2024
avatar Hackwar Hackwar - close - 29 Mar 2024
avatar Hackwar Hackwar - change - 29 Mar 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-03-29 20:28:55
Closed_By Hackwar
avatar Hackwar
Hackwar - comment - 29 Mar 2024

Yes, writing --admin-password -uhoh will fail, however I would say that is normal behavior on the CLI. The solution here is to use --admin-password="-uhoh" to escape that properly. Since this is not a bug, I'm closing this one.

Add a Comment

Login with GitHub to post a comment