Skip to content

Commit

Permalink
update other omitted flags
Browse files Browse the repository at this point in the history
Signed-off-by: Emily Rodriguez <ecrodriguez@mm279976-pc.lan>
  • Loading branch information
Emily Rodriguez committed Mar 15, 2022
1 parent 6ccf441 commit d928bbc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
6 changes: 2 additions & 4 deletions src/commands/convert/aws_config2hdf.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import BaseCommand from '../../utils/base-command'
import BaseCommand, {omitFlags} from '../../utils/base-command'
import {OutputFlags} from '@oclif/parser'
import {flags} from '@oclif/command'
import fs from 'fs'
Expand All @@ -16,9 +16,7 @@ export default class AWSConfig2HDF extends BaseCommand {
static examples = ['saf convert:aws_config2hdf -a ABCDEFGHIJKLMNOPQRSTUV -s +4NOT39A48REAL93SECRET934 -r us-east-1 -o output-hdf-name.json']

static flags = {
...BaseCommand.flags,
input: flags.string({hidden: true}),
..._.omit(BaseCommand.flags, 'input'),
...omitFlags(['input']),
accessKeyId: flags.string({char: 'a', required: false}),
secretAccessKey: flags.string({char: 's', required: false}),
sessionToken: flags.string({char: 't', required: false}),
Expand Down
6 changes: 2 additions & 4 deletions src/commands/convert/sonarqube2hdf.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import BaseCommand from '../../utils/base-command'
import BaseCommand, {omitFlags} from '../../utils/base-command'
import {OutputFlags} from '@oclif/parser'
import {flags} from '@oclif/command'
import fs from 'fs'
Expand All @@ -15,9 +15,7 @@ export default class Sonarqube2HDF extends BaseCommand {
static examples = ['saf convert:sonarqube2hdf -n sonar_project_key -u http://sonar:9000 --auth YOUR_API_KEY -o scan_results.json']

static flags = {
...BaseCommand.flags,
input: flags.string({hidden: true}),
..._.omit(BaseCommand.flags, 'input'),
...omitFlags(['input']),
auth: flags.string({char: 'a', required: true}),
projectKey: flags.string({char: 'n', required: true}),
url: flags.string({char: 'u', required: true}),
Expand Down
4 changes: 2 additions & 2 deletions src/utils/base-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export function omitFlags(flagsToOmit: string[]): typeof BaseCommand.flags {
export default abstract class BaseCommand extends Command {
static flags = {
help: flags.help({char: 'h'}),
input: flags.string({char: 'i', required: false, description: 'Input file to be converted'}),
output: flags.string({char: 'o', required: false}),
input: flags.string({char: 'i', required: true, description: 'Input file to be converted'}),
output: flags.string({char: 'o', required: true}),
logLevel: flags.string({char: 'L', required: false, default: 'info', options: ['info', 'warn', 'debug', 'verbose']}),
listAllCommands: flags.boolean({char: 'A', required: false, description: 'List all SAF CLI commands'}),
}
Expand Down

0 comments on commit d928bbc

Please sign in to comment.