Skip to content

Commit

Permalink
Merge pull request #4279 from hashicorp/f-short-init
Browse files Browse the repository at this point in the history
Add job init '-short' command docs to website
  • Loading branch information
nickethier committed May 11, 2018
2 parents c36e323 + 32ec72d commit ddab0f1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
13 changes: 9 additions & 4 deletions command/job_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"io/ioutil"
"os"
"strings"

"github.com/posener/complete"
)

const (
Expand Down Expand Up @@ -39,6 +41,13 @@ func (c *JobInitCommand) Synopsis() string {
return "Create an example job file"
}

func (c *JobInitCommand) AutocompleteFlags() complete.Flags {
return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient),
complete.Flags{
"-short": complete.PredictNothing,
})
}

func (c *JobInitCommand) Name() string { return "job init" }

func (c *JobInitCommand) Run(args []string) int {
Expand Down Expand Up @@ -95,10 +104,6 @@ job "example" {
datacenters = ["dc1"]
group "cache" {
ephemeral_disk {
size = 300
}
task "redis" {
driver = "docker"
Expand Down
4 changes: 4 additions & 0 deletions website/source/docs/commands/job/init.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ groups, runtime constraints, and resource allocation.
Please refer to the [jobspec][] and [drivers](/docs/drivers/index.html)
pages to learn how to customize the template.

## Init Options

* `-short`: If set, a minimal jobspec without comments is emitted.

## Examples

Generate an example job file:
Expand Down

0 comments on commit ddab0f1

Please sign in to comment.