Skip to content

Commit

Permalink
Set flag options for register command dynamically
Browse files Browse the repository at this point in the history
This enables us to see all available options when running `zapier register --help`
  • Loading branch information
gregilo committed Feb 10, 2023
1 parent f406588 commit 1166e16
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/cli.html
Original file line number Diff line number Diff line change
Expand Up @@ -894,8 +894,8 @@ <h2 id="register">register</h2>
<li><code>title</code> | Your integrations&apos;s public title. Asked interactively if not present.</li>
</ul><p><strong>Flags</strong></p><ul>
<li><code>-D, --desc</code> | A sentence describing your app in 140 characters or less, e.g. &quot;Trello is a team collaboration tool to organize tasks and keep projects on track.&quot;</li>
<li><code>-u, --url</code> | The homepage URL of your app. This will also be used as the email domain that would allow team members to join your integration as a Collaborator. Learn more.</li>
<li><code>-a, --audience</code> | Are you building a public or private integration? Public integration development receives priority support and launch promotion from the Zapier team.</li>
<li><code>-u, --url</code> | The homepage URL of your app, e.g., <a href="https://example.com">https://example.com</a>.</li>
<li><code>-a, --audience</code> | Are you building a public or private integration?</li>
<li><code>-r, --role</code> | What is your relationship with the app you&apos;re integrating with Zapier?</li>
<li><code>-c, --category</code> | How would you categorize your app? Choose the most appropriate option for your app&apos;s core features.</li>
<li><code>-s, --subscribe</code> | Get tips and recommendations about this integration along with our monthly newsletter that details the performance of your integration and the latest Zapier news.</li>
Expand Down
4 changes: 2 additions & 2 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,8 @@ This will change the `./.zapierapprc` (which identifies this directory as holdi

**Flags**
* `-D, --desc` | A sentence describing your app in 140 characters or less, e.g. "Trello is a team collaboration tool to organize tasks and keep projects on track."
* `-u, --url` | The homepage URL of your app. This will also be used as the email domain that would allow team members to join your integration as a Collaborator. Learn more.
* `-a, --audience` | Are you building a public or private integration? Public integration development receives priority support and launch promotion from the Zapier team.
* `-u, --url` | The homepage URL of your app, e.g., https://example.com.
* `-a, --audience` | Are you building a public or private integration?
* `-r, --role` | What is your relationship with the app you're integrating with Zapier?
* `-c, --category` | How would you categorize your app? Choose the most appropriate option for your app's core features.
* `-s, --subscribe` | Get tips and recommendations about this integration along with our monthly newsletter that details the performance of your integration and the latest Zapier news.
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/docs/cli.html
Original file line number Diff line number Diff line change
Expand Up @@ -894,8 +894,8 @@ <h2 id="register">register</h2>
<li><code>title</code> | Your integrations&apos;s public title. Asked interactively if not present.</li>
</ul><p><strong>Flags</strong></p><ul>
<li><code>-D, --desc</code> | A sentence describing your app in 140 characters or less, e.g. &quot;Trello is a team collaboration tool to organize tasks and keep projects on track.&quot;</li>
<li><code>-u, --url</code> | The homepage URL of your app. This will also be used as the email domain that would allow team members to join your integration as a Collaborator. Learn more.</li>
<li><code>-a, --audience</code> | Are you building a public or private integration? Public integration development receives priority support and launch promotion from the Zapier team.</li>
<li><code>-u, --url</code> | The homepage URL of your app, e.g., <a href="https://example.com">https://example.com</a>.</li>
<li><code>-a, --audience</code> | Are you building a public or private integration?</li>
<li><code>-r, --role</code> | What is your relationship with the app you&apos;re integrating with Zapier?</li>
<li><code>-c, --category</code> | How would you categorize your app? Choose the most appropriate option for your app&apos;s core features.</li>
<li><code>-s, --subscribe</code> | Get tips and recommendations about this integration along with our monthly newsletter that details the performance of your integration and the latest Zapier news.</li>
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,8 @@ This will change the `./.zapierapprc` (which identifies this directory as holdi

**Flags**
* `-D, --desc` | A sentence describing your app in 140 characters or less, e.g. "Trello is a team collaboration tool to organize tasks and keep projects on track."
* `-u, --url` | The homepage URL of your app. This will also be used as the email domain that would allow team members to join your integration as a Collaborator. Learn more.
* `-a, --audience` | Are you building a public or private integration? Public integration development receives priority support and launch promotion from the Zapier team.
* `-u, --url` | The homepage URL of your app, e.g., https://example.com.
* `-a, --audience` | Are you building a public or private integration?
* `-r, --role` | What is your relationship with the app you're integrating with Zapier?
* `-c, --category` | How would you categorize your app? Choose the most appropriate option for your app's core features.
* `-s, --subscribe` | Get tips and recommendations about this integration along with our monthly newsletter that details the performance of your integration and the latest Zapier news.
Expand Down
20 changes: 20 additions & 0 deletions packages/cli/src/oclif/hooks/getAppRegistrationFieldChoices.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,24 @@ module.exports = async function (options) {
}

this.config.enumFieldChoices = enumFieldChoices;

// This enables us to see all available options when running `zapier register --help`
const cmd = options.config.findCommand('register');
if (cmd && cmd.flags) {
if (cmd.flags.audience) {
cmd.flags.audience.options = formFields.intention.map(
(audienceOption) => audienceOption.value
);
}
if (cmd.flags.role) {
cmd.flags.role.options = formFields.role.map(
(roleOption) => roleOption.value
);
}
if (cmd.flags.category) {
cmd.flags.category.options = formFields.app_category.map(
(categoryOption) => categoryOption.value
);
}
}
};

0 comments on commit 1166e16

Please sign in to comment.