Skip to content

Commit 056f00c

Browse files
committed
docs: update readme and cli to document new "develop" functionality
1 parent d81b0f9 commit 056f00c

File tree

3 files changed

+29
-20
lines changed

3 files changed

+29
-20
lines changed

README.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@ Download the `firstgo` binary for your platform from
2121

2222
`firstgo` runs in `demo`, `init` or `serve` modes:
2323

24-
* **demo**: `./firstgo demo` runs the embedded demo to show how `firstgo` works
25-
* **init**: `./firstgo init` initialises a new project by writing the demo project to disk
26-
* **serve**: `./firstgo serve config.yaml` serves project files from disk
24+
* **demo**: `./firstgo demo` runs the embedded demo to show how
25+
`firstgo` works
26+
* **init**: `./firstgo init` initialises a new project by writing the
27+
demo project to disk
28+
* **serve**: `./firstgo serve config.yaml` serves project files from
29+
disk
30+
* **develop**: `./firstgo develop config.yaml` serves project files from
31+
disk with automatic reloads after changes to `config.yaml` and
32+
template files.
2733

2834
To deploy your custom content in production, either copy your project
2935
files with the binary to your production setting, or copy your project
@@ -56,24 +62,26 @@ set out in [utils](./utils/).
5662
./firstgo -h
5763
5864
NAME:
59-
firstgo - A web server for prototyping web interfaces from sketched images.
65+
firstgo - A web server for prototyping web interfaces from sketches
6066
6167
USAGE:
6268
firstgo [global options] [command]
6369
6470
DESCRIPTION:
65-
The server uses a config.yaml file to describe clickable zones on
66-
images in assets/images to build an interactive website.
71+
The firstgo server uses a config.yaml file to describe clickable
72+
zones on images in assets/images to build an interactive website.
6773
6874
For a demo with embedded assets and config file, use 'demo'.
6975
To start a new project, use 'init' to write the demo files to disk.
7076
To serve files on disk use 'serve'.
77+
To serve files on disk in development mode use 'develop'.
7178
7279
COMMANDS:
73-
serve Serve content on disk with the provided config
74-
init Initialize a new project in a directory
75-
demo Run the embedded demo server
76-
help Shows a list of commands or help for one command
80+
serve Serve content on disk
81+
develop Serve content on disk with automatic file reloads
82+
init Initialize a new project in a directory
83+
demo Run the embedded demo server
84+
help Shows a list of commands or help for one command
7785
7886
Run 'firstgo [command] --help' for more information on a command.
7987
```

cli.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ import (
1313

1414
const (
1515
ShortUsage = "A web server for prototyping web interfaces from sketches"
16-
LongDescription = `The server uses a config.yaml file to describe clickable zones on
17-
images in assets/images to build an interactive website.
16+
LongDescription = `The firstgo server uses a config.yaml file to describe clickable
17+
zones on images in assets/images to build an interactive website.
1818
1919
For a demo with embedded assets and config file, use 'demo'.
2020
To start a new project, use 'init' to write the demo files to disk.
21-
To serve files on disk use 'serve'.`
21+
To serve files on disk use 'serve'.
22+
To serve files on disk in development mode use 'develop'.`
2223
)
2324

2425
// Applicator is an interface to the central coordinator for the project
@@ -50,7 +51,7 @@ func BuildCLI(app Applicator) *cli.Command {
5051

5152
serveCmd := &cli.Command{
5253
Name: "serve",
53-
Usage: "Serve content on disk with the provided config",
54+
Usage: "Serve content on disk",
5455
ArgsUsage: "CONFIG_FILE",
5556
// use the common flags
5657
Flags: []cli.Flag{
@@ -81,8 +82,8 @@ func BuildCLI(app Applicator) *cli.Command {
8182
}
8283

8384
serveInDevelopmentCmd := &cli.Command{
84-
Name: "development",
85-
Usage: "Serve from disk in development mode",
85+
Name: "develop",
86+
Usage: "Serve content on disk with automatic file reloads",
8687
ArgsUsage: "CONFIG_FILE",
8788
// use common flags
8889
Flags: []cli.Flag{

cli_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,20 +99,20 @@ func TestParseCLI(t *testing.T) {
9999
},
100100
{
101101
name: "development all options",
102-
args: []string{"program", "development", "-a", "127.0.0.1", "-p", "8001", "-s", "html", "config.yaml"},
102+
args: []string{"program", "develop", "-a", "127.0.0.1", "-p", "8001", "-s", "html", "config.yaml"},
103103
},
104104
{
105105
name: "development only config",
106-
args: []string{"program", "development", "config.yaml"},
106+
args: []string{"program", "develop", "config.yaml"},
107107
},
108108
{
109109
name: "development no config",
110-
args: []string{"program", "development", "--address", "127.0.0.2"},
110+
args: []string{"program", "develop", "--address", "127.0.0.2"},
111111
wantErrContains: "missing required argument",
112112
},
113113
{
114114
name: "development no suffix",
115-
args: []string{"program", "development", "-a", "127.0.0.1", "-p", "8001", "-s", "", "config.yaml"},
115+
args: []string{"program", "develop", "-a", "127.0.0.1", "-p", "8001", "-s", "", "config.yaml"},
116116
wantErrContains: "empty suffix argument",
117117
},
118118
}

0 commit comments

Comments
 (0)