@@ -434,6 +434,9 @@ public function install( $args, $assoc_args ) {
434434 * - yaml
435435 * ---
436436 *
437+ * [--skip-update-check]
438+ * : Skip checking for updates. This is faster and avoids authentication issues with GitHub or Composer repositories.
439+ *
437440 * ## AVAILABLE FIELDS
438441 *
439442 * These fields will be displayed by default for each package:
@@ -458,6 +461,14 @@ public function install( $args, $assoc_args ) {
458461 * | wp-cli/server-command | Daniel Bachhuber | dev-main | available | 2.x-dev |
459462 * +-----------------------+------------------+----------+-----------+----------------+
460463 *
464+ * # List installed packages without checking for updates.
465+ * $ wp package list --skip-update-check
466+ * +-----------------------+------------------+----------+--------+----------------+
467+ * | name | authors | version | update | update_version |
468+ * +-----------------------+------------------+----------+--------+----------------+
469+ * | wp-cli/server-command | Daniel Bachhuber | dev-main | none | |
470+ * +-----------------------+------------------+----------+--------+----------------+
471+ *
461472 * @subcommand list
462473 */
463474 public function list_ ( $ args , $ assoc_args ) {
@@ -757,8 +768,9 @@ private function show_packages( $context, $packages, $assoc_args ) {
757768 ];
758769 $ assoc_args = array_merge ( $ defaults , $ assoc_args );
759770
760- $ composer = $ this ->get_composer ();
761- $ list = [];
771+ $ skip_update_check = Utils \get_flag_value ( $ assoc_args , 'skip-update-check ' , false );
772+ $ composer = $ this ->get_composer ();
773+ $ list = [];
762774 foreach ( $ packages as $ package ) {
763775 $ name = $ package ->getPrettyName ();
764776 if ( isset ( $ list [ $ name ] ) ) {
@@ -771,7 +783,7 @@ private function show_packages( $context, $packages, $assoc_args ) {
771783 $ package_output ['version ' ] = [ $ package ->getPrettyVersion () ];
772784 $ update = 'none ' ;
773785 $ update_version = '' ;
774- if ( 'list ' === $ context ) {
786+ if ( 'list ' === $ context && ! $ skip_update_check ) {
775787 try {
776788 $ latest = $ this ->find_latest_package ( $ package , $ composer , null );
777789 if ( $ latest && $ latest ->getFullPrettyVersion () !== $ package ->getFullPrettyVersion () ) {
0 commit comments