Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.

Commit

Permalink
Merge pull request #148 from devoncarew/devoncarew_readable_names
Browse files Browse the repository at this point in the history
add human readable names
  • Loading branch information
devoncarew committed Nov 13, 2014
2 parents d9d3e9f + 31a5005 commit 2aa17cb
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/generators/consoleapp.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import 'consoleapp_data.dart';
class ConsoleAppGenerator extends DefaultGenerator {
ConsoleAppGenerator() : super(
'consoleapp',
'Console Application',
'A simple command-line application.',
categories: const ['dart', 'console', 'minimal']) {

Expand Down
1 change: 1 addition & 0 deletions lib/generators/package.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import 'package_data.dart';
class PackageGenerator extends DefaultGenerator {
PackageGenerator() : super(
'package',
'Dart Package',
'A starting point for Dart libraries or applications.',
categories: const ['dart']) {

Expand Down
1 change: 1 addition & 0 deletions lib/generators/polymerapp.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import 'polymerapp_data.dart';
class PolymerAppGenerator extends DefaultGenerator {
PolymerAppGenerator() : super(
'polymerapp',
'Polymer Web Application',
'A web app built using polymer.dart.',
categories: const ['dart', 'web']) {

Expand Down
1 change: 1 addition & 0 deletions lib/generators/shelfserver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import 'shelfserver_data.dart';
class ShelfServerGenerator extends DefaultGenerator {
ShelfServerGenerator() : super(
'shelfserver',
'Shelf Web Server',
'A web server built using the shelf package.',
categories: const ['dart', 'shelf', 'server']) {

Expand Down
1 change: 1 addition & 0 deletions lib/generators/webapp.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import 'webapp_data.dart';
class WebAppGenerator extends DefaultGenerator {
WebAppGenerator() : super(
'webapp',
'Web Application',
"A web app for the developer that doesn’t want to be confused by too "
"much going on.",
categories: const ['dart', 'web']) {
Expand Down
3 changes: 2 additions & 1 deletion lib/src/cli_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ class CliApp {
Iterable itor = generators.map((Generator generator) {
Map m = {
'name': generator.id,
'label': generator.label,
'description': generator.description
};

Expand Down Expand Up @@ -251,7 +252,7 @@ class CliApp {
_out('Stagehand will generate the given application type into the current directory.');
_out('');
_out('usage: ${APP_NAME} <generator-name>');
_out(argParser.getUsage());
_out(argParser.usage);
_out('');
_out('Available generators:');
int len = generators
Expand Down
5 changes: 3 additions & 2 deletions lib/src/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@ List<String> wrap(String str, [int col = 80]) {
* An abstract implementation of a [Generator].
*/
abstract class DefaultGenerator extends Generator {
DefaultGenerator(String id, String description, {List<String> categories: const []})
: super(id, description, categories: categories);
DefaultGenerator(String id, String label, String description,
{List<String> categories: const []})
: super(id, label, description, categories: categories);

TemplateFile addFile(String path, String contents) =>
addTemplateFile(new TemplateFile(path, contents));
Expand Down
3 changes: 2 additions & 1 deletion lib/stagehand.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,14 @@ Generator getGenerator(String id) {
*/
abstract class Generator implements Comparable<Generator> {
final String id;
final String label;
final String description;
final List<String> categories;

final List<TemplateFile> files = [];
TemplateFile _entrypoint;

Generator(this.id, this.description, {this.categories: const []});
Generator(this.id, this.label, this.description, {this.categories: const []});

/**
* The entrypoint of the application; the main file for the project, which an
Expand Down

0 comments on commit 2aa17cb

Please sign in to comment.