{"record":{"id":"2c27326a8b38a1e7","repo":"phacility/phabricator","slug":"too-many-arguments-expected-only-a-configuration","errorCode":null,"errorMessage":"Too many arguments: expected only a configuration key when using \"--stdin\".","messagePattern":"Too many arguments: expected only a configuration key when using \"--stdin\"\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"error","filePath":"src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php","lineNumber":45,"sourceCode":"            'wildcard'  => true,\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $argv = $args->getArg('args');\n    if (!$argv) {\n      throw new PhutilArgumentUsageException(\n        pht('Specify the configuration key you want to set.'));\n    }\n\n    $is_stdin = $args->getArg('stdin');\n\n    $key = $argv[0];\n\n    if ($is_stdin) {\n      if (count($argv) > 1) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Too many arguments: expected only a configuration key when '.\n            'using \"--stdin\".'));\n      }\n\n      fprintf(STDERR, tsprintf(\"%s\\n\", pht('Reading value from stdin...')));\n      $value = file_get_contents('php://stdin');\n    } else {\n      if (count($argv) == 1) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Specify a value to set the configuration key \"%s\" to, or '.\n            'use \"--stdin\" to read a value from stdin.',\n            $key));\n      }\n\n      if (count($argv) > 2) {\n        throw new PhutilArgumentUsageException(","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php#L27-L63","documentation":"Usage guard in the config set CLI workflow: fires when --stdin is used together with more than one positional argument. When reading the value from stdin, only the configuration key itself may be given on the command line, so extra arguments abort the run.","triggerScenarios":"Thrown at src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php:45 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass only the key and pipe the value in: echo <value> | bin/config set --stdin <key>"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","contentChangedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}