diff --git a/command/job_init.go b/command/job_init.go index 4f900479fee..69ded3aa359 100644 --- a/command/job_init.go +++ b/command/job_init.go @@ -5,6 +5,8 @@ import ( "io/ioutil" "os" "strings" + + "github.com/posener/complete" ) const ( @@ -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 { @@ -95,10 +104,6 @@ job "example" { datacenters = ["dc1"] group "cache" { - ephemeral_disk { - size = 300 - } - task "redis" { driver = "docker" diff --git a/website/source/docs/commands/job/init.html.md.erb b/website/source/docs/commands/job/init.html.md.erb index 9f4f2407733..e126c397ebf 100644 --- a/website/source/docs/commands/job/init.html.md.erb +++ b/website/source/docs/commands/job/init.html.md.erb @@ -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: