Comments

greg.1.anderson’s picture

Title: core-topics command needs content » core-topic command needs content, and should print files with 'less'
Status: Active » Needs review
StatusFileSize
new14.43 KB

Still needs a little touch-up in terms of comments and documentation (coming soon), but feel free to review the code.

I use 'less' to display the file; something that we might want to consider for pm-releasenotes too.

I had to fix drush_shell_exec_interactive to make 'less' work.

I needed to add drush_redispatch($command), because backend invoke also kills interactivity.

moshe weitzman’s picture

Status: Needs review » Needs work

I like the new topics (free content!), and drush_dispatch().

I'm not too keen on the change to topic- to indicate a topic. The problem is that I don't want contrib and custom code using our namespace. They should do what they do with regular commands and stick to own namespace. So, devel module will do devel-firephp and devel-profiling and so on. I'll acknowledge that this is a matter of taste. Lets follow our own rules, such that the new commands are prefixed with core- or docs-. The docs- commands would live in a new docs.drush.inc.

Also, drush_print_file() returns TRUE sometimes but not others. Not sure if thats intended.

greg.1.anderson’s picture

Okay, that's fine. I'm not sure, though, which commands are "core-" and which are "docs-". core-readme and core-api, and docs-{examples folder items}?

moshe weitzman’s picture

i'd day they should all be prefixed the same. lets do docs- and a docs.drush.inc

greg.1.anderson’s picture

Status: Needs work » Needs review
StatusFileSize
new11.63 KB

Revised per #2/#4 + a few comments

greg.1.anderson’s picture

StatusFileSize
new14.53 KB

Forgot to include 'docs' commandfile in the diff.

jonhattan’s picture

I'll use drush_print_file() in #977584: Improvements to pm-releasenotes and other commands leveraging it..

@greg note your patchs here include the code of #983222: Suggest releases to download when there is no recommended release; use pm-releases without bootstrapping Drupal.

I'm working on a skeleton for drush developer-docs (see drupal ones: http://drupalcode.org/viewvc/drupal/contributions/docs/developer/) for #988530: api.drush.ws. Still not sure how it is related to core-topic but I see they will meet in some point.

greg.1.anderson’s picture

StatusFileSize
new9.55 KB

Whoops. Here's a patch without the extra bonus features.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

~/htd/fr$ drush st --help
Undefined variable: implemented command.inc:349                      [warning]
Undefined index: bootstrap drush.php:91                              [warning]
Undefined index: bootstrap command.inc:933                           [warning]
Undefined index: core command.inc:975                                [warning]
Undefined index: command drush.php:97                                [warning]
Undefined index: commandfile drush.php:97                            [warning]
Undefined index: command command.inc:793                             [warning]
Undefined index: callback drush.inc:50                               [warning]
call_user_func_array() expects parameter 1 to be a valid callback, no[warning]
array or string given drush.inc:50

Code is ready, we just need to fix up these warnings. Feel free to commit after that.

moshe weitzman’s picture

Oh, and ideally make-me-a-sandwich ships with a topic so we demonstrate topic system. No need to actually write interesting content unless you want to.

greg.1.anderson’s picture

Okay. I'm writing content for context, commands, hooks, bootstrap, etc. right now. I'll add in a stub in sandwich.

moshe weitzman’s picture

Also lets append a sentence to your general help statement so it reads: "Execute a drush command. Run `drush help [command]` to view command-specific
help. Run `drush topic` to read even more documentation."

greg.1.anderson’s picture

Status: Reviewed & tested by the community » Fixed

Committed, now with 11 topics (12 including the stub topic for sandwich.drush.inc).

Status: Fixed » Closed (fixed)

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