Skip to content

Commit

Permalink
fix: 🐛 added the url parameter to the header
Browse files Browse the repository at this point in the history
In the HELP message the URL parameter was at the bottom. Now it is
together with the other required parameters
  • Loading branch information
ziccardi committed Dec 16, 2020
1 parent 0121eb2 commit 7a45406
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/cmds/app-cmds/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const describe = 'create a new application';

export const builder = (yargs: Argv) => {
return yargs
.group(['name', 'output'], 'Create application:')
.group(['url', 'name', 'output'], 'Create application:')
.option('name', {
required: true,
type: 'string',
Expand Down
10 changes: 5 additions & 5 deletions src/cmds/app-cmds/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@ export const describe = 'delete applications';
export const builder = (yargs: Argv) => {
return yargs
.group(
['name', 'app-id', 'description', 'developer'],
['url', 'name', 'app-id', 'description', 'developer'],
'Delete Applications:'
)
.option('name', {
required: false,
type: 'string',
describe: 'Returns all the applications with a given name',
describe: 'Deletes all the applications with a given name',
requiresArg: true,
})
.option('app-id', {
required: false,
type: 'string',
describe: 'Return the application identified by the given id',
describe: 'Deletes the application identified by the given id',
requiresArg: true,
})
.option('description', {
required: false,
type: 'string',
describe: 'Returns all the applications matching the given description',
describe: 'Deletes all the applications matching the given description',
requiresArg: true,
})
.option('developer', {
required: false,
type: 'string',
describe: 'Returns all the applications matching the given developer',
describe: 'Deletes all the applications matching the given developer',
requiresArg: true,
})
.help();
Expand Down
4 changes: 2 additions & 2 deletions src/cmds/app-cmds/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const describe = 'lists the applications';
export const builder = (yargs: Argv) => {
return yargs
.group(
['app-id', 'name', 'description', 'developer', 'output'],
['url', 'app-id', 'name', 'description', 'developer', 'output'],
'Applications list:'
)
.option('name', {
Expand All @@ -25,7 +25,7 @@ export const builder = (yargs: Argv) => {
.option('app-id', {
required: false,
type: 'string',
describe: 'Return the application identified by the given id',
describe: 'Returns the application identified by the given id',
requiresArg: true,
})
.option('description', {
Expand Down
2 changes: 1 addition & 1 deletion src/cmds/app-cmds/rename.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const describe = 'rename one application';

export const builder = (yargs: Argv) => {
return yargs
.group(['app-id', 'output'], 'Rename Application:')
.group(['url', 'app-id', 'name', 'output'], 'Rename Application:')
.option('app-id', {
required: true,
type: 'string',
Expand Down
1 change: 1 addition & 0 deletions src/cmds/variants-cmds/create-cmds/andoridVariant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const builder = (yargs: Argv) => {
return yargs
.group(
[
'url',
'app-id',
'name',
'server-key',
Expand Down
1 change: 1 addition & 0 deletions src/cmds/variants-cmds/create-cmds/iosCert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const builder = (yargs: Argv) => {
return yargs
.group(
[
'url',
'app-id',
'name',
'certificate',
Expand Down
1 change: 1 addition & 0 deletions src/cmds/variants-cmds/create-cmds/iosToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const builder = (yargs: Argv) => {
return yargs
.group(
[
'url',
'app-id',
'name',
'bundle-id',
Expand Down
2 changes: 1 addition & 1 deletion src/cmds/variants-cmds/create-cmds/webpushVariant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const describe = 'Create a new WebPush variant';

export const builder = (yargs: Argv) => {
return yargs
.group(['app-id', 'name', 'alias'], 'Create Variant:')
.group(['url', 'app-id', 'name', 'alias', 'output'], 'Create Variant:')
.option('alias', {
required: true,
type: 'string',
Expand Down
12 changes: 11 additions & 1 deletion src/cmds/variants-cmds/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,22 @@ export const describe = 'delete variant(s)';

export const builder = (yargs: Argv) => {
return yargs
.group(['app-id', 'name', 'developer', 'type'], 'Delete Variants:')
.group(
['app-id', 'variant-id', 'name', 'developer', 'type'],
'Delete Variants:'
)
.option('app-id', {
required: true,
type: 'string',
describe: 'The application id',
requiresArg: true,
})
.option('variant-id', {
required: false,
type: 'string',
describe: 'Deletes the variant identified by the specified id',
requiresArg: true,
})
.option('name', {
required: false,
type: 'string',
Expand All @@ -38,6 +47,7 @@ export const builder = (yargs: Argv) => {
export const handler = async (argv: Arguments<VariantFilter>) => {
const filter = {
pushApplicationID: argv.appId as string,
variantID: argv.variantId as string,
...argv,
};
const deletedVariants = await UPSAdminClientFactory.getUpsAdminInstance(argv)
Expand Down
16 changes: 12 additions & 4 deletions src/cmds/variants-cmds/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,22 @@ exports.describe =

export const builder = (yargs: Argv) => {
return yargs
.group(['app-id', 'type', 'name', 'developer', 'output'], 'Variants list:')
.group(
['url', 'app-id', 'variant-id', 'type', 'name', 'developer', 'output'],
'List variants:'
)
.option('app-id', {
required: true,
type: 'string',
describe: 'The application id',
requiresArg: true,
})
.option('variant-id', {
required: false,
type: 'string',
describe: 'The variant id',
requiresArg: true,
})
.option('name', {
required: false,
type: 'string',
Expand Down Expand Up @@ -49,9 +58,8 @@ export const builder = (yargs: Argv) => {

export const handler = async (argv: Arguments<VariantFilter>) => {
const filter: VariantFilter = {
name: argv.name,
developer: argv.developer,
type: argv.type,
variantID: argv.variantId as string,
...argv,
};

const variants = await UPSAdminClientFactory.getUpsAdminInstance(argv)
Expand Down

0 comments on commit 7a45406

Please sign in to comment.