What’s New in Drush 6 · • Completes almost everything in Drush • Global options before...

18
Building Bridges, Connecting Communities Moshe Weitzman, Jonathan Hedstrom, Owen Barton What’s New in Drush 6 Wednesday, May 22, 13

Transcript of What’s New in Drush 6 · • Completes almost everything in Drush • Global options before...

Page 1: What’s New in Drush 6 · • Completes almost everything in Drush • Global options before command, command specific options after • Your commands can provide argument completion

Building Bridges, Connecting Communities

Moshe Weitzman, Jonathan Hedstrom, Owen Barton

What’s New in Drush 6

Wednesday, May 22, 13

Page 2: What’s New in Drush 6 · • Completes almost everything in Drush • Global options before command, command specific options after • Your commands can provide argument completion

Output Formats

• Most commands support --format option• Supported formats: json, csv, export, ...• More formatters are easily added• Command authors just return their data• drush topic docs-output-formats

Wednesday, May 22, 13

Page 3: What’s New in Drush 6 · • Completes almost everything in Drush • Global options before command, command specific options after • Your commands can provide argument completion

Output Formats$items['version'] = array( 'outputformat' => array( 'default' => 'key-value', 'pipe-format' => 'string', ), );

Wednesday, May 22, 13

Page 4: What’s New in Drush 6 · • Completes almost everything in Drush • Global options before command, command specific options after • Your commands can provide argument completion

Roles and Permissions

• CRUD for roles• Add remove permissions to roles• Add/remove roles to users

Wednesday, May 22, 13

Page 5: What’s New in Drush 6 · • Completes almost everything in Drush • Global options before command, command specific options after • Your commands can provide argument completion

Config (D8)

• CRUD for config system• Quickly Edit & Import

Wednesday, May 22, 13

Page 6: What’s New in Drush 6 · • Completes almost everything in Drush • Global options before command, command specific options after • Your commands can provide argument completion

6

Shell Aliases

'noncore' => 'pm-list --no-core'

'pulldb' => '!git pull && drush updb'

add to any drushrc.php

Wednesday, May 22, 13

Page 7: What’s New in Drush 6 · • Completes almost everything in Drush • Global options before command, command specific options after • Your commands can provide argument completion

drush[make]api = 2core = "7.x"projects[ctools][version] = "1.3"

; http://d.org/node/1120028#comment-5792282projects[ctools][patch][] = "http://p1.patch"projects[views][version] = "3.7"

Wednesday, May 22, 13

Page 8: What’s New in Drush 6 · • Completes almost everything in Drush • Global options before command, command specific options after • Your commands can provide argument completion

New for 6.x(most backported to 5.x)

Wednesday, May 22, 13

Page 9: What’s New in Drush 6 · • Completes almost everything in Drush • Global options before command, command specific options after • Your commands can provide argument completion

Local patches

• Patch copied into project directory

Wednesday, May 22, 13

Page 10: What’s New in Drush 6 · • Completes almost everything in Drush • Global options before command, command specific options after • Your commands can provide argument completion

Use a distribution as core

core = 7.xprojects[kickstart][type] = "core"projects[kickstart][version] = "7.x-1.8"

Wednesday, May 22, 13

Page 11: What’s New in Drush 6 · • Completes almost everything in Drush • Global options before command, command specific options after • Your commands can provide argument completion

Quick Drupal can use a makefile

drush qd --makefile=mysite.make

Wednesday, May 22, 13

Page 12: What’s New in Drush 6 · • Completes almost everything in Drush • Global options before command, command specific options after • Your commands can provide argument completion

Per-project working-dir

projects[cap][download][revision] = "c9794ad"projects[cap][download][working-copy] = 1

Wednesday, May 22, 13

Page 13: What’s New in Drush 6 · • Completes almost everything in Drush • Global options before command, command specific options after • Your commands can provide argument completion

Set defaults

defaults[projects][subdir] = "contrib"

instead of: projects[foo][subdir] = "contrib"projects[bar][subdir] = "contrib"

Wednesday, May 22, 13

Page 14: What’s New in Drush 6 · • Completes almost everything in Drush • Global options before command, command specific options after • Your commands can provide argument completion

quick-drupal & runserver• The quick-drupal (qd) command installs a

throwaway Drupal site• Drush core-runserver (rs) is a built-in web

server (requires php-cgi, or php 5.4+)

Wednesday, May 22, 13

Page 15: What’s New in Drush 6 · • Completes almost everything in Drush • Global options before command, command specific options after • Your commands can provide argument completion

site-set

• Persists a site (local or remote) in your terminal without typing @alias each time

• Customize your prompt (PS1)• In your .bashrc:source drush/drush.complete.shPS1='\u@\h \w$(__drush_ps1 "[%s]")\$ '

Wednesday, May 22, 13

Page 16: What’s New in Drush 6 · • Completes almost everything in Drush • Global options before command, command specific options after • Your commands can provide argument completion

user-login turbo• Use a Drupal path as an argument and it will

log you in any open that path in a single operation

• You can now reference target user by name, id or e-mail address

Wednesday, May 22, 13

Page 17: What’s New in Drush 6 · • Completes almost everything in Drush • Global options before command, command specific options after • Your commands can provide argument completion

Completion• Completes almost everything in Drush• Global options before command, command

specific options after• Your commands can provide argument

completion too• In your .bashrcsource path/drush/drush.complete.sh

Wednesday, May 22, 13

Page 18: What’s New in Drush 6 · • Completes almost everything in Drush • Global options before command, command specific options after • Your commands can provide argument completion

Building Bridges, Connecting Communities

Evaluate this session at: portland2013.drupal.org/schedule

Thank you!

What did you think?

Wednesday, May 22, 13