From ac21530db0e442db981dc4fe19ae8fe6d66092a0 Mon Sep 17 00:00:00 2001 From: Ryan Uber Date: Tue, 15 Sep 2015 13:39:57 -0700 Subject: [PATCH] website: use a helper for general options --- website/helpers/command_helpers.rb | 9 +++++++++ ...rce-leave.html.md => agent-force-leave.html.md.erb} | 3 +-- .../{agent-info.html.md => agent-info.html.md.erb} | 3 +-- .../{agent-join.html.md => agent-join.html.md.erb} | 3 +-- ...agent-members.html.md => agent-members.html.md.erb} | 3 +-- .../docs/commands/{agent.html.md => agent.html.md.erb} | 0 .../docs/commands/{index.html.md => index.html.md.erb} | 0 .../{node-drain.html.md => node-drain.html.md.erb} | 10 +++++++--- .../{node-status.html.md => node-status.html.md.erb} | 3 +-- .../commands/{status.html.md => status.html.md.erb} | 3 +-- .../commands/{version.html.md => version.html.md.erb} | 0 11 files changed, 22 insertions(+), 15 deletions(-) create mode 100644 website/helpers/command_helpers.rb rename website/source/docs/commands/{agent-force-leave.html.md => agent-force-leave.html.md.erb} (83%) rename website/source/docs/commands/{agent-info.html.md => agent-info.html.md.erb} (91%) rename website/source/docs/commands/{agent-join.html.md => agent-join.html.md.erb} (86%) rename website/source/docs/commands/{agent-members.html.md => agent-members.html.md.erb} (89%) rename website/source/docs/commands/{agent.html.md => agent.html.md.erb} (100%) rename website/source/docs/commands/{index.html.md => index.html.md.erb} (100%) rename website/source/docs/commands/{node-drain.html.md => node-drain.html.md.erb} (82%) rename website/source/docs/commands/{node-status.html.md => node-status.html.md.erb} (92%) rename website/source/docs/commands/{status.html.md => status.html.md.erb} (92%) rename website/source/docs/commands/{version.html.md => version.html.md.erb} (100%) diff --git a/website/helpers/command_helpers.rb b/website/helpers/command_helpers.rb new file mode 100644 index 000000000..45d437599 --- /dev/null +++ b/website/helpers/command_helpers.rb @@ -0,0 +1,9 @@ +module CommandHelpers + # Returns the markdown text for the general options usage. + def general_options_usage() + <`: The address of the Nomad server. Overrides the "NOMAD_ADDR" + environment variable if set. Defaults to "http://127.0.0.1:4646". +EOF + end +end diff --git a/website/source/docs/commands/agent-force-leave.html.md b/website/source/docs/commands/agent-force-leave.html.md.erb similarity index 83% rename from website/source/docs/commands/agent-force-leave.html.md rename to website/source/docs/commands/agent-force-leave.html.md.erb index f2f25325d..00117d2ed 100644 --- a/website/source/docs/commands/agent-force-leave.html.md +++ b/website/source/docs/commands/agent-force-leave.html.md.erb @@ -24,8 +24,7 @@ to enter the "left" state. ## General Options -* `-address`: The address of the Nomad server. Overrides the `NOMAD_ADDR` - environment variable if set. Defaults to `http://127.0.0.1:4646`. +<%= general_options_usage %> ## Examples diff --git a/website/source/docs/commands/agent-info.html.md b/website/source/docs/commands/agent-info.html.md.erb similarity index 91% rename from website/source/docs/commands/agent-info.html.md rename to website/source/docs/commands/agent-info.html.md.erb index fc1b3ceb8..ad4da0601 100644 --- a/website/source/docs/commands/agent-info.html.md +++ b/website/source/docs/commands/agent-info.html.md.erb @@ -20,8 +20,7 @@ nomad agent-info [options] ## General Options -* `-address`: The address of the Nomad server. Overrides the `NOMAD_ADDR` - environment variable if set. Defaults to `http://127.0.0.1:4646`. +<%= general_options_usage %> ## Output diff --git a/website/source/docs/commands/agent-join.html.md b/website/source/docs/commands/agent-join.html.md.erb similarity index 86% rename from website/source/docs/commands/agent-join.html.md rename to website/source/docs/commands/agent-join.html.md.erb index e9988dd91..951c8cd3e 100644 --- a/website/source/docs/commands/agent-join.html.md +++ b/website/source/docs/commands/agent-join.html.md.erb @@ -26,8 +26,7 @@ be 1. ## General Options -* `-address`: The address of the Nomad server. Overrides the `NOMAD_ADDR` - environment variable if set. Defaults to `http://127.0.0.1:4646`. +<%= general_options_usage %> ## Examples diff --git a/website/source/docs/commands/agent-members.html.md b/website/source/docs/commands/agent-members.html.md.erb similarity index 89% rename from website/source/docs/commands/agent-members.html.md rename to website/source/docs/commands/agent-members.html.md.erb index 639b396d5..7e9de4553 100644 --- a/website/source/docs/commands/agent-members.html.md +++ b/website/source/docs/commands/agent-members.html.md.erb @@ -20,8 +20,7 @@ nomad agent-members [options] ## General Options -* `-address`: The address of the Nomad server. Overrides the `NOMAD_ADDR` - environment variable if set. Defaults to `http://127.0.0.1:4646`. +<%= general_options_usage %> ## Members Options diff --git a/website/source/docs/commands/agent.html.md b/website/source/docs/commands/agent.html.md.erb similarity index 100% rename from website/source/docs/commands/agent.html.md rename to website/source/docs/commands/agent.html.md.erb diff --git a/website/source/docs/commands/index.html.md b/website/source/docs/commands/index.html.md.erb similarity index 100% rename from website/source/docs/commands/index.html.md rename to website/source/docs/commands/index.html.md.erb diff --git a/website/source/docs/commands/node-drain.html.md b/website/source/docs/commands/node-drain.html.md.erb similarity index 82% rename from website/source/docs/commands/node-drain.html.md rename to website/source/docs/commands/node-drain.html.md.erb index c8c3acd3f..03c22189f 100644 --- a/website/source/docs/commands/node-drain.html.md +++ b/website/source/docs/commands/node-drain.html.md.erb @@ -26,13 +26,17 @@ disable drain mode for. It is also required to pass one of `-enable` or ## General Options -* `-address`: The address of the Nomad server. Overrides the `NOMAD_ADDR` - environment variable if set. Defaults to `http://127.0.0.1:4646`. +<%= general_options_usage %> + +## Node Drain Options + +* `-enable`: Enable node drain mode. +* `-disable`: Disable node drain mode. ## Examples Enable drain mode on node1: ``` -$ nomad node-drain node1 +$ nomad node-drain -enable node1 ``` diff --git a/website/source/docs/commands/node-status.html.md b/website/source/docs/commands/node-status.html.md.erb similarity index 92% rename from website/source/docs/commands/node-status.html.md rename to website/source/docs/commands/node-status.html.md.erb index 58080863c..784fe26a7 100644 --- a/website/source/docs/commands/node-status.html.md +++ b/website/source/docs/commands/node-status.html.md.erb @@ -26,8 +26,7 @@ displayed. ## General Options -* `-address`: The address of the Nomad server. Overrides the `NOMAD_ADDR` - environment variable if set. Defaults to `http://127.0.0.1:4646`. +<%= general_options_usage %> ## Node Status Options diff --git a/website/source/docs/commands/status.html.md b/website/source/docs/commands/status.html.md.erb similarity index 92% rename from website/source/docs/commands/status.html.md rename to website/source/docs/commands/status.html.md.erb index cdd09895e..9cd57ecea 100644 --- a/website/source/docs/commands/status.html.md +++ b/website/source/docs/commands/status.html.md.erb @@ -23,8 +23,7 @@ useful status fields for each. ## General Options -* `-address`: The address of the Nomad server. Overrides the `NOMAD_ADDR` - environment variable if set. Defaults to `http://127.0.0.1:4646`. +<%= general_options_usage %> ## Status Options diff --git a/website/source/docs/commands/version.html.md b/website/source/docs/commands/version.html.md.erb similarity index 100% rename from website/source/docs/commands/version.html.md rename to website/source/docs/commands/version.html.md.erb