Skip to content

Commit d888f75

Browse files
authored
Merge pull request #591 from wp-cli/copilot/add-command-syntax-explanation
Add argument syntax reference to command documentation
2 parents 951fa8f + 9759ffd commit d888f75

File tree

5 files changed

+985
-817
lines changed

5 files changed

+985
-817
lines changed

bin/command.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,10 @@ private static function gen_cmd_pages( $cmd, $parent = [], $verbose = false ) {
649649
}
650650
$docs = preg_replace( '/(#?## GLOBAL PARAMETERS).+/s', $replace_global, $docs );
651651

652+
// Add link to argument syntax documentation after OPTIONS heading.
653+
$options_note = 'See the [argument syntax](https://make.wordpress.org/cli/handbook/references/argument-syntax/) reference for a detailed explanation of the syntax conventions used.';
654+
$docs = preg_replace( '/(### OPTIONS)/', '$1' . PHP_EOL . PHP_EOL . $options_note, $docs );
655+
652656
$binding['docs'] = $docs;
653657
}
654658

0 commit comments

Comments
 (0)