How to use the @salesforce/command.flags.boolean function in @salesforce/command

To help you get started, we’ve selected a few @salesforce/command examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stomita / sfdx-migration-automatic / src / commands / automig / dump.ts View on Github external
char: 'f',
      description: messages.getMessage('configFlagDescription')
    }),
    objects: flags.array({
      char: 'o',
      description: messages.getMessage('objectsFlagDescription'),
      map: (value: string) => {
        const [ object, target = 'query' ] = value.split(':');
        return { object, target };
      }
    }),
    outputdir: flags.directory({
      char: 'd',
      description: messages.getMessage('outputDirFlagDescription')
    }),
    excludebom: flags.boolean({
      description: messages.getMessage('excludeBomFlagDescription')
    })
  };

  // Comment this out if your command does not require an org username
  protected static requiresUsername = true;

  // Comment this out if your command does not support a hub org username
  protected static supportsDevhubUsername = false;

  // Set this to true if your command requires a project workspace; 'requiresProject' is false by default
  protected static requiresProject = false;

  public async run(): Promise<AnyJson> {
    // const name = this.flags.name || 'world';
github stomita / sfdx-migration-automatic / src / commands / automig / load.ts View on Github external
protected static flagsConfig = {
    // flag with a value (-n, --name=VALUE)
    inputdir: flags.directory({
      char: 'd',
      description: messages.getMessage('inputDirFlagDescription'),
      required: true
    }),
    mappingobjects: flags.array({
      char: 'm',
      description: messages.getMessage('mappingObjectsFlagDescription'),
      map: (value: string) => {
        const [ object, keyField = 'Name' ] = value.split(':');
        return { object, keyField };
      }
    }),
    deletebeforeload: flags.boolean({
      description: messages.getMessage('deleteBeforeLoadFlagDescription')
    }),
    verbose: flags.builtin()
  };

  // Comment this out if your command does not require an org username
  protected static requiresUsername = true;

  // Comment this out if your command does not support a hub org username
  protected static supportsDevhubUsername = false;

  // Set this to true if your command requires a project workspace; 'requiresProject' is false by default
  protected static requiresProject = false;

  /**
   *
github wadewegner / sfdx-waw-plugin / src / commands / waw / connectedapp / create.ts View on Github external
export default class ConnectedAppCreate extends SfdxCommand {
  public static description = messages.getMessage('connectedapp.create.description');
  public static examples = [];

  public static readonly flagsConfig = {
    name: flags.string({
      char: 'n',
      description: messages.getMessage('connectedapp.create.flags.name'),
      required: true
    }),
    label: flags.string({
      char: 'l',
      description: messages.getMessage('connectedapp.create.flags.label')
    }),
    certificate: flags.boolean({
      char: 'r',
      description: messages.getMessage('connectedapp.create.flags.certificate')
    }),
    callbackurl: flags.string({
      char: 'c',
      description: messages.getMessage('connectedapp.create.flags.callbackurl')
    }),
    description: flags.string({
      char: 'd',
      description: messages.getMessage('connectedapp.create.flags.description')
    }),
    scopes: flags.string({
      // Basic,Api,Web,Full,Chatter,CustomApplications,RefreshToken,OpenID,CustomPermissions,Wave,Eclair
      char: 's',
      description: messages.getMessage('connectedapp.create.flags.scopes')
    }),
github billryoung / sfdx-wry-plugin / src / commands / wry / hello / org.ts View on Github external
public static examples = [
  `$ sfdx hello:org --targetusername myOrg@example.com --targetdevhubusername devhub@org.com
  Hello world! This is org: MyOrg and I will be around until Tue Mar 20 2018!
  My hub org id is: 00Dxx000000001234
  `,
  `$ sfdx hello:org --name myname --targetusername myOrg@example.com
  Hello myname! This is org: MyOrg and I will be around until Tue Mar 20 2018!
  `
  ];

  public static args = [{name: 'file'}];

  protected static flagsConfig = {
    // flag with a value (-n, --name=VALUE)
    name: flags.string({char: 'n', description: messages.getMessage('nameFlagDescription')}),
    force: flags.boolean({char: 'f', description: messages.getMessage('forceFlagDescription')})
  };

  // Comment this out if your command does not require an org username
  protected static requiresUsername = true;

  // Comment this out if your command does not support a hub org username
  protected static supportsDevhubUsername = true;

  // Set this to true if your command requires a project workspace; 'requiresProject' is false by default
  protected static requiresProject = false;

  public async run(): Promise<core.AnyJson> {
    const name = this.flags.name || 'world';

    // this.org is guaranteed because requiresUsername=true, as opposed to supportsUsername
    const conn = this.org.getConnection();
github ChuckJonas / sfdx-git-packager / src / commands / git / package.ts View on Github external
'$ sfdx git:package -d deploy/my-feature',
    '$ sfdx git:package -s feature-b -d deploy/feature-b'
  ];

  // not sure what this does...
  public static args = [
    { name: 'file' }
  ];

  protected static flagsConfig = {
    // flag with a value (-n, --name=VALUE)
    sourceref: flags.string({ char: 's', description: messages.getMessage('fromBranchDescription'), default: 'head' }),
    targetref: flags.string({ char: 't', description: messages.getMessage('toBranchDescription'), default: 'master' }),
    outputdir: flags.string({ char: 'd', description: messages.getMessage('outputdirDescription'), required: true }),
    ignorewhitespace: flags.boolean({ char: 'w', description: messages.getMessage('ignoreWhitespace') }),
    purge: flags.boolean({ description: messages.getMessage('purgeDescription') }),
    nodelete: flags.boolean({ description: messages.getMessage('nodelete') }),
    force: flags.boolean({ char: 'f', description: messages.getMessage('force') })
  };

  // Comment this out if your command does not require an org username
  protected static requiresUsername = false;

  // Comment this out if your command does not support a hub org username
  protected static supportsDevhubUsername = false;

  // Set this to true if your command requires a project workspace; 'requiresProject' is false by default
  protected static requiresProject = true;

  private projectPath: string;

  private sourcePaths: string[];
github ChuckJonas / sfdx-git-packager / src / commands / git / package.ts View on Github external
'$ sfdx git:package -s my-awesome-feature -t master -d deploy/my-feature',
    '$ sfdx git:package -d deploy/my-feature',
    '$ sfdx git:package -s feature-b -d deploy/feature-b'
  ];

  // not sure what this does...
  public static args = [
    { name: 'file' }
  ];

  protected static flagsConfig = {
    // flag with a value (-n, --name=VALUE)
    sourceref: flags.string({ char: 's', description: messages.getMessage('fromBranchDescription'), default: 'head' }),
    targetref: flags.string({ char: 't', description: messages.getMessage('toBranchDescription'), default: 'master' }),
    outputdir: flags.string({ char: 'd', description: messages.getMessage('outputdirDescription'), required: true }),
    ignorewhitespace: flags.boolean({ char: 'w', description: messages.getMessage('ignoreWhitespace') }),
    purge: flags.boolean({ description: messages.getMessage('purgeDescription') }),
    nodelete: flags.boolean({ description: messages.getMessage('nodelete') }),
    force: flags.boolean({ char: 'f', description: messages.getMessage('force') })
  };

  // Comment this out if your command does not require an org username
  protected static requiresUsername = false;

  // Comment this out if your command does not support a hub org username
  protected static supportsDevhubUsername = false;

  // Set this to true if your command requires a project workspace; 'requiresProject' is false by default
  protected static requiresProject = true;

  private projectPath: string;
github afawcett / dependencies-cli / src / commands / andyinthecloud / dependencies / report.ts View on Github external
import {MetadataComponentDependency, Node} from '../../../lib/NodeDefs';
import {Member, PackageMerger} from '../../../lib/PackageMerger';

core.Messages.importMessagesDirectory(__dirname);
const messages = core.Messages.loadMessages('dependencies-cli', 'depends');

export default class Report extends SfdxCommand {
  public static description = messages.getMessage('description');
  public static examples = [messages.getMessage('example1')];

  protected static flagsConfig = {
    resultformat: flags.string({ char: 'r', description: messages.getMessage('resultformatFlagDescription'), default: 'dot', options: ['dot', 'xml'] }),
    includelist: flags.string({char: 'i', description: messages.getMessage('includeListDescription')}),
    excludelist: flags.string({char: 'e', description: messages.getMessage('excludeListDescription')}),
    outputdir: flags.string({char: 'd', description: messages.getMessage('outputDirDescription')}),
    generatemanifest: flags.boolean({char: 'm', description: messages.getMessage('generateManifestDescription')}),
    excludepackagefile: flags.string({
      char: 'x',
      description: messages.getMessage('excludePackageDescription'),
      dependsOn: ['generatemanifest']
    }),
    includealldependencies: flags.boolean({
      char: 'a',
      description: messages.getMessage('getIncludeDependencies'),
      dependsOn: ['includelist']
    }),
    includealldependents: flags.boolean({
      char: 't',
      description: messages.getMessage('getIncludeDependents'),
      dependsOn: ['includelist']
    }),
    validate: flags.boolean({
github nawforce / ApexLink / assist / cli / src / commands / apexlink / check.ts View on Github external
"list of directories to search for Apex class files, defaults to current directory\n" +
        "use [<namespace>=]directory for multiple packages, packages are loaded in first seen order.\n" +
        "Use <namespace>= without a directory to disable type errors for that namespace"
    }
  ];

  public static strict = false;

  protected static flagsConfig = {
    json: flags.boolean({
      description: "show output in json format (disables --verbose && --csv)"
    }),
    csv: flags.boolean({
      description: "show output in csv format (disables --verbose)"
    }),
    depends: flags.boolean({
      description: "show dependency information for Apex classes"
    }),
    zombies: flags.boolean({
      description: "show class fields, properties & methods that are not being used"
    }),
    warnings: flags.boolean({
      description: "show warnings messages for legal but possibly faulty code "
    }),
    verbose: flags.builtin({
      description: "show progress messages"
    })
  };

  protected static requiresUsername = false;
  protected static supportsDevhubUsername = false;
  protected static requiresProject = false;
github nawforce / ApexLink / assist / cli / src / commands / apexlink / check.ts View on Github external
];

  public static args = [
    {
      name: "directories",
      description:
        "list of directories to search for Apex class files, defaults to current directory\n" +
        "use [<namespace>=]directory for multiple packages, packages are loaded in first seen order.\n" +
        "Use <namespace>= without a directory to disable type errors for that namespace"
    }
  ];

  public static strict = false;

  protected static flagsConfig = {
    json: flags.boolean({
      description: "show output in json format (disables --verbose && --csv)"
    }),
    csv: flags.boolean({
      description: "show output in csv format (disables --verbose)"
    }),
    depends: flags.boolean({
      description: "show dependency information for Apex classes"
    }),
    zombies: flags.boolean({
      description: "show class fields, properties & methods that are not being used"
    }),
    warnings: flags.boolean({
      description: "show warnings messages for legal but possibly faulty code "
    }),
    verbose: flags.builtin({
      description: "show progress messages"
github afawcett / dependencies-cli / src / commands / andyinthecloud / dependencies / report.ts View on Github external
resultformat: flags.string({ char: 'r', description: messages.getMessage('resultformatFlagDescription'), default: 'dot', options: ['dot', 'xml'] }),
    includelist: flags.string({char: 'i', description: messages.getMessage('includeListDescription')}),
    excludelist: flags.string({char: 'e', description: messages.getMessage('excludeListDescription')}),
    outputdir: flags.string({char: 'd', description: messages.getMessage('outputDirDescription')}),
    generatemanifest: flags.boolean({char: 'm', description: messages.getMessage('generateManifestDescription')}),
    excludepackagefile: flags.string({
      char: 'x',
      description: messages.getMessage('excludePackageDescription'),
      dependsOn: ['generatemanifest']
    }),
    includealldependencies: flags.boolean({
      char: 'a',
      description: messages.getMessage('getIncludeDependencies'),
      dependsOn: ['includelist']
    }),
    includealldependents: flags.boolean({
      char: 't',
      description: messages.getMessage('getIncludeDependents'),
      dependsOn: ['includelist']
    }),
    validate: flags.boolean({
      char: 'v',
      description: messages.getMessage('validateDescription')
    })

  };

  protected static requiresUsername = true;

  public async run(): Promise<core.AnyJson> {
    const conn = this.org.getConnection();
    conn.version = '43.0';