I wanted to run a restore job from the command-line and started with

drush provision-restore --help

Restore the site to a previous backup. This will also generate a backup of the site as it was.

Arguments:
 domain.com                                The domain of the site to be restored 
 site_backup.tar.gz                        The backup to restore the site to.    

So I tried something like: drush provision-restore mysite.com ~/backup/mysite.com-1111.tar.gz

Could not find backup file mysite.com

So the argument domain.com is just wrong, ok next try.

I tried something like(cwd = the site directory): drush provision-restore ~/backup/mysite.com-1111.tar.gz

This gave the non-helpful error:
Backup directory does not exist.

What it should have been: drush @mysite.com provision-restore ~/backup/mysite.com-1111.tar.gz

It's obvious to me that the domein.com argument needs to be removed from the help. But how can we make it clear the a @mysite alias is mandatory?

The attached patch removes the domain.com argument and also adds an example which shows @mysite

It looks like the argument description has been copied to most of the provision commands... these should be checked.

Comments

steven jones’s picture

Yup, this one needs some attention.

Anonymous’s picture

Status: Needs review » Needs work
StatusFileSize
new12.92 KB

The example looks a bit weird in my tests, I think we are hitting some sort of Drush CLI styling issue where the actual example code wraps, and it looks as though the 'description' carries along the same line.

Not sure what we can do about it really.. I guess the (correct) example code is just too long..

Anonymous’s picture

The other thing is, basically *all* provision commands need the context's alias name prefixed.. not just this one. So we'd either be obliged to provide examples for *all* (not that bad an idea, if we can get it to look ok), or none..

Anonymous’s picture

StatusFileSize
new14.12 KB

We'd have to increase the drush_print_table in drush_print_help() to 60 chars (from 40) - not sure Drush developers would put this in just so our help commands look nicer :)



  foreach ($command['sections'] as $key => $value) {
    if (!empty($command[$key])) {
      drush_print(dt($value) . ':');
      $rows = drush_format_help_section($command, $key);
      drush_print_table($rows, FALSE, array(60)); // This was 40
      unset($rows);
      drush_print();
    }
  }

Anonymous’s picture

Maybe it's just my 12" thinkpad screen. See #1005816: Improve readability by wordwrapping long messages

steven jones’s picture

Version: 7.x-2.x-dev » 6.x-1.x-dev

The wrapping is a drush problem, I think as long as we've provided a decent example then if drush then decides to format it badly, it's not our fault!

(This can totally happen in 6.x-1.x, so updating branch)

helmo’s picture

Version: 6.x-1.x-dev » 7.x-2.x-dev

I've noticed the ugly wrapping of examples, but as you point out that's a different issue.

Adding examples for all commands would be good, but removing the false information about the 'domain.com' argument is more important to me.

helmo’s picture

Version: 7.x-2.x-dev » 6.x-1.x-dev
Anonymous’s picture

Status: Needs work » Fixed

yep agreed. I've pushed this commit, thanks! Will add other examples to the other commands separately soon.

Anonymous’s picture

It turned out that many more help commands used the 'domain' argument too and other args such as platform paths etc (provision-migrate, provision-clone)

I've now updated all of them and added examples for them all too, that show the @alias prefix.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit fc95fef on 6.x-1.x, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by mig5:
    #1322208 by helmo - fix provision-restore help information and add an...
  • Commit d5dca73 on 6.x-2.x, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by mig5:
    #1322208 by helmo - fix provision-restore help information and add an...