Skip to content

Commit

Permalink
Merge pull request withfig#453 from withfig/sean/v7_spec
Browse files Browse the repository at this point in the history
Migrate to v7 spec format
  • Loading branch information
mschrage authored Aug 9, 2021
2 parents 603ca14 + a5f060c commit f3bc145
Show file tree
Hide file tree
Showing 167 changed files with 2,378 additions and 2,374 deletions.
12 changes: 6 additions & 6 deletions dev/adb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ const completionSpec: Fig.Spec = {
},
{
name: "[PARAMETER...]",
variadic: true,
isVariadic: true,
isOptional: true,
},
],
Expand Down Expand Up @@ -481,7 +481,7 @@ const completionSpec: Fig.Spec = {
{
name: "PACKAGE",
template: "filepaths",
variadic: true,
isVariadic: true,
},
],
options: [
Expand All @@ -500,7 +500,7 @@ const completionSpec: Fig.Spec = {
{
name: "PACKAGE",
template: "filepaths",
variadic: true,
isVariadic: true,
},
],
options: [
Expand Down Expand Up @@ -544,7 +544,7 @@ const completionSpec: Fig.Spec = {
args: {
isOptional: true,
name: "COMMANDS ...",
variadic: true,
isVariadic: true,
},
},
{
Expand Down Expand Up @@ -580,7 +580,7 @@ const completionSpec: Fig.Spec = {
args: [
{
name: "LOCAL",
variadic: true,
isVariadic: true,
template: "filepaths",
},
{
Expand Down Expand Up @@ -647,7 +647,7 @@ const completionSpec: Fig.Spec = {
args: [
{
name: "REMOTE",
variadic: true,
isVariadic: true,
template: "filepaths",
},
{
Expand Down
6 changes: 3 additions & 3 deletions dev/amplify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const completionSpec: Fig.Spec = {
{
name: "--name",
description: "Mandatory flag.",
required: true,
isRequired: true,
args: {
name: "env-name",
description: "Env name",
Expand All @@ -83,7 +83,7 @@ const completionSpec: Fig.Spec = {
{
name: "--name",
description: "Mandatory flag.",
required: true,
isRequired: true,
args: {
name: "env-name",
description: "Env name",
Expand All @@ -93,7 +93,7 @@ const completionSpec: Fig.Spec = {
{
name: "--config",
description: "Specify provider configs.",
required: true,
isRequired: true,
args: {},
},
{
Expand Down
18 changes: 9 additions & 9 deletions dev/aws/acm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const generators: Record<string, Fig.Generator> = {
return triggerPrefix(newToken, oldToken, _prefixFile);
},

filterTerm: (token) => {
getQueryTerm: (token) => {
return filterWithPrefix(token, _prefixFile);
},
},
Expand All @@ -151,7 +151,7 @@ const generators: Record<string, Fig.Generator> = {
return triggerPrefix(newToken, oldToken, _prefixBlob);
},

filterTerm: (token) => {
getQueryTerm: (token) => {
return filterWithPrefix(token, _prefixBlob);
},
},
Expand Down Expand Up @@ -200,7 +200,7 @@ const completionSpec: Fig.Spec = {
"The key-value pair that defines the tag. The tag value is optional.",
args: {
name: "list",
variadic: true,
isVariadic: true,
description: "Key=string,Value=string",
},
},
Expand Down Expand Up @@ -439,7 +439,7 @@ const completionSpec: Fig.Spec = {
"One or more resource tags to associate with the imported certificate. Note: You cannot apply tags when reimporting a certificate.",
args: {
name: "list",
variadic: true,
isVariadic: true,
description: "Key=string,Value=string",
},
},
Expand Down Expand Up @@ -473,7 +473,7 @@ const completionSpec: Fig.Spec = {
description: "Filter the certificate list by status value.",
args: {
name: "list",
variadic: true,
isVariadic: true,
suggestions: [
"PENDING_VALIDATION",
"ISSUED",
Expand Down Expand Up @@ -642,7 +642,7 @@ const completionSpec: Fig.Spec = {
description: "The key-value pair that defines the tag to remove.",
args: {
name: "list",
variadic: true,
isVariadic: true,
description: "Key=string,Value=string",
},
},
Expand Down Expand Up @@ -728,7 +728,7 @@ const completionSpec: Fig.Spec = {
"Additional FQDNs to be included in the Subject Alternative Name extension of the ACM certificate. For example, add the name www.example.net to a certificate for which the DomainName field is www.example.com if users can reach your site by using either name. The maximum number of domain names that you can add to an ACM certificate is 100. However, the initial quota is 10 domain names. If you need more than 10 names, you must request a quota increase. For more information, see Quotas. The maximum length of a SAN DNS name is 253 octets. The name is made up of multiple labels separated by periods. No label can be longer than 63 octets. Consider the following examples: (63 octets).(63 octets).(63 octets).(61 octets) is legal because the total length is 253 octets (63+1+63+1+63+1+61) and no label exceeds 63 octets. (64 octets).(63 octets).(63 octets).(61 octets) is not legal because the total length exceeds 253 octets (64+1+63+1+63+1+61) and the first label exceeds 63 octets. (63 octets).(63 octets).(63 octets).(62 octets) is not legal because the total length of the DNS name (63+1+63+1+63+1+62) exceeds 253 octets.",
args: {
name: "list",
variadic: true,
isVariadic: true,
},
},
{
Expand All @@ -745,7 +745,7 @@ const completionSpec: Fig.Spec = {
"The domain name that you want ACM to use to send you emails so that you can validate domain ownership.",
args: {
name: "list",
variadic: true,
isVariadic: true,
description: "DomainName=string,ValidationDomain=string",
},
},
Expand Down Expand Up @@ -773,7 +773,7 @@ const completionSpec: Fig.Spec = {
"One or more resource tags to associate with the certificate.",
args: {
name: "list",
variadic: true,
isVariadic: true,
description: "Key=string,Value=string",
},
},
Expand Down
52 changes: 26 additions & 26 deletions dev/aws/amplify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const postPrecessGenerator = (
};

const customGenerator = async (
context: string[],
tokens: string[],
executeShellCommand: Fig.ExecuteShellCommandFunction,
command: string,
options: string[],
Expand All @@ -49,11 +49,11 @@ const customGenerator = async (

for (let i = 0; i < options.length; i++) {
const option = options[i];
const idx = context.indexOf(option);
const idx = tokens.indexOf(option);
if (idx < 0) {
continue;
}
const param = context[idx + 1];
const param = tokens[idx + 1];
cmd += ` ${option} ${param}`;
}

Expand Down Expand Up @@ -188,7 +188,7 @@ const generators: Record<string, Fig.Generator> = {
return triggerPrefix(newToken, oldToken, _prefixFile);
},

filterTerm: (token) => {
getQueryTerm: (token) => {
return filterWithPrefix(token, _prefixFile);
},
},
Expand Down Expand Up @@ -244,9 +244,9 @@ const generators: Record<string, Fig.Generator> = {
},

listEnvironemntNames: {
custom: async function (context, executeShellCommand) {
custom: async function (tokens, executeShellCommand) {
return customGenerator(
context,
tokens,
executeShellCommand,
"list-backend-environments",
["--app-id"],
Expand All @@ -257,9 +257,9 @@ const generators: Record<string, Fig.Generator> = {
},

listEnvironemntArns: {
custom: async function (context, executeShellCommand) {
custom: async function (tokens, executeShellCommand) {
return customGenerator(
context,
tokens,
executeShellCommand,
"list-backend-environments",
["--app-id"],
Expand All @@ -270,9 +270,9 @@ const generators: Record<string, Fig.Generator> = {
},

listBranchNames: {
custom: async function (context, executeShellCommand) {
custom: async function (tokens, executeShellCommand) {
return customGenerator(
context,
tokens,
executeShellCommand,
"list-branches",
["--app-id"],
Expand All @@ -283,9 +283,9 @@ const generators: Record<string, Fig.Generator> = {
},

listFrameworkForApp: {
custom: async function (context, executeShellCommand) {
custom: async function (tokens, executeShellCommand) {
return customGenerator(
context,
tokens,
executeShellCommand,
"list-branches",
["--app-id"],
Expand All @@ -296,9 +296,9 @@ const generators: Record<string, Fig.Generator> = {
},

listBuildSpecForApp: {
custom: async function (context, executeShellCommand) {
custom: async function (tokens, executeShellCommand) {
return customGenerator(
context,
tokens,
executeShellCommand,
"list-branches",
["--app-id"],
Expand All @@ -316,9 +316,9 @@ const generators: Record<string, Fig.Generator> = {
},

listDomainNames: {
custom: async function (context, executeShellCommand) {
custom: async function (tokens, executeShellCommand) {
return customGenerator(
context,
tokens,
executeShellCommand,
"list-domain-associations",
["--app-id"],
Expand All @@ -329,9 +329,9 @@ const generators: Record<string, Fig.Generator> = {
},

listJobIds: {
custom: async function (context, executeShellCommand) {
custom: async function (tokens, executeShellCommand) {
return customGenerator(
context,
tokens,
executeShellCommand,
"list-jobs",
["--app-id", "--branch-name"],
Expand Down Expand Up @@ -524,7 +524,7 @@ const completionSpec: Fig.Spec = {
"The automated branch creation glob patterns for an Amplify app.",
args: {
name: "list",
variadic: true,
isVariadic: true,
},
},
{
Expand Down Expand Up @@ -863,7 +863,7 @@ const completionSpec: Fig.Spec = {
description: "The setting for the subdomain.",
args: {
name: "list",
variadic: true,
isVariadic: true,
description: "prefix=string,branchName=string",
},
},
Expand All @@ -873,7 +873,7 @@ const completionSpec: Fig.Spec = {
"Sets the branch patterns for automatic subdomain creation.",
args: {
name: "list",
variadic: true,
isVariadic: true,
},
},
{
Expand Down Expand Up @@ -2251,7 +2251,7 @@ const completionSpec: Fig.Spec = {
description: "The tag keys to use to untag a resource.",
args: {
name: "list",
variadic: true,
isVariadic: true,
},
},
{
Expand Down Expand Up @@ -2367,7 +2367,7 @@ const completionSpec: Fig.Spec = {
name: "list",
description:
"source=string,target=string,status=string,condition=string",
variadic: true,
isVariadic: true,
},
},
{
Expand Down Expand Up @@ -2400,7 +2400,7 @@ const completionSpec: Fig.Spec = {
"Describes the automated branch creation glob patterns for an Amplify app.",
args: {
name: "list",
variadic: true,
isVariadic: true,
},
},
{
Expand Down Expand Up @@ -2649,7 +2649,7 @@ const completionSpec: Fig.Spec = {
description: "Describes the settings for the subdomain.",
args: {
name: "list",
variadic: true,
isVariadic: true,
description: "prefix=string,branchName=string",
},
},
Expand All @@ -2667,7 +2667,7 @@ const completionSpec: Fig.Spec = {
"The required AWS Identity and Access Management (IAM) service role for the Amazon Resource Name (ARN) for automatically creating subdomains.",
args: {
name: "string",
variadic: true,
isVariadic: true,
generators: generators.listIamRoleArns,
},
},
Expand Down
Loading

0 comments on commit f3bc145

Please sign in to comment.