How to use the @oclif/command.flags function in @oclif/command

To help you get started, we’ve selected a few @oclif/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 GetStream / stream-cli / lib / commands / user / remove.js View on Github external
cov_1ws4rif622.s[6]++;
      this.exit(0);
    } catch (err) {
      cov_1ws4rif622.s[7]++;
      this.error(err, {
        exit: 1
      });
    }
  }

}

exports.UserRemove = UserRemove;

_defineProperty(UserRemove, "flags", {
  id: _command.flags.string({
    char: 'i',
    description: _chalk.default.blue.bold('Channel name.'),
    required: true
  }),
  type: _command.flags.string({
    char: 't',
    description: _chalk.default.blue.bold('Channel type.'),
    required: true
  }),
  moderators: _command.flags.string({
    char: 'm',
    description: _chalk.default.blue.bold('Comma separated list of moderators to remove.'),
    required: true
  })
});
github GetStream / stream-cli / lib / commands / channel / init.js View on Github external
cov_i783mv28z.s[14]++;
      this.exit(0);
    } catch (err) {
      cov_i783mv28z.s[15]++;
      this.error(err, {
        exit: 1
      });
    }
  }

}

exports.ChannelInit = ChannelInit;

_defineProperty(ChannelInit, "flags", {
  id: _command.flags.string({
    char: 'i',
    description: _chalk.default.blue.bold('Channel ID.'),
    default: (0, _v.default)(),
    required: true
  }),
  type: _command.flags.string({
    char: 't',
    description: _chalk.default.blue.bold('Type of channel.'),
    options: ['livestream', 'messaging', 'gaming', 'commerce', 'team'],
    required: true
  }),
  name: _command.flags.string({
    char: 'n',
    description: _chalk.default.blue.bold('Name of room.'),
    required: true
  }),
github GetStream / stream-cli / lib / commands / user / add.js View on Github external
cov_2nmzwr8l86.s[6]++;
      this.exit(0);
    } catch (err) {
      cov_2nmzwr8l86.s[7]++;
      this.error(err, {
        exit: 1
      });
    }
  }

}

exports.UserAdd = UserAdd;

_defineProperty(UserAdd, "flags", {
  id: _command.flags.string({
    char: 'i',
    description: _chalk.default.blue.bold('Channel name.'),
    required: true
  }),
  type: _command.flags.string({
    char: 't',
    description: _chalk.default.blue.bold('Channel type.'),
    required: true
  }),
  moderators: _command.flags.string({
    char: 'm',
    description: _chalk.default.blue.bold('Comma separated list of moderators to add.'),
    required: true
  })
});
github smartcontractkit / chainlink / tools / sa_requester / lib / index.js View on Github external
})

      return axios
        .post(url, serviceAgreementRequest, { timeout: FETCH_TIMEOUT })
        .then(parseResponse)
        .then(data => [addresses[i], data.attributes.signature])
        .catch(parseError)
    }),
  )
}

SaRequester.description =
  'Collect the signatures for a service agreement from multiple chainlink nodes'
SaRequester.flags = {
  version: command.flags.version({ char: 'v' }),
  help: command.flags.help({ char: 'h' }),
  agreement: command.flags.string({
    char: 'a',
    description: 'Location of agreement',
  }),
}
SaRequester.args = [{ name: 'file' }]

module.exports = SaRequester
github netlify / cli / src / commands / api.js View on Github external
APICommand.args = [
  {
    name: 'apiMethod',
    description: 'Open API method to run'
  }
]

APICommand.examples = ['netlify api --list', 'netlify api getSite --data \'{ "site_id": "123456"}\'']

APICommand.flags = {
  data: oclif.flags.string({
    char: 'd',
    description: 'Data to use'
  }),
  list: oclif.flags.boolean({
    description: 'List out available API methods'
  })
}

APICommand.strict = false

module.exports = APICommand
github GetStream / stream-cli / lib / commands / channel / query.js View on Github external
exports.ChannelQuery = ChannelQuery;

_defineProperty(ChannelQuery, "flags", {
  id: _command.flags.string({
    char: 'i',
    description: _chalk.default.blue.bold('Channel ID.'),
    default: (0, _v.default)(),
    required: false
  }),
  type: _command.flags.string({
    char: 't',
    description: _chalk.default.blue.bold('Type of channel.'),
    options: ['livestream', 'messaging', 'gaming', 'commerce', 'team'],
    required: false
  }),
  filter: _command.flags.string({
    char: 'f',
    description: _chalk.default.blue.bold('Filters to apply.'),
    required: false
  }),
  sort: _command.flags.string({
    char: 's',
    description: _chalk.default.blue.bold('Sort to apply.'),
    required: false
  })
});

cov_1padvcu0s.s[9]++;
ChannelQuery.description = 'Query a channel';