Merge pull request #2115 from balena-io/fix-booleans

Standardize boolean flag typing
This commit is contained in:
bulldozer-balena[bot] 2020-12-07 14:12:14 +00:00 committed by GitHub
commit adadefdf3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 22 additions and 6 deletions

View File

@ -28,7 +28,7 @@ interface ExtendedApplication extends ApplicationWithDeviceType {
interface FlagsDef {
help: void;
verbose?: boolean;
verbose: boolean;
}
export default class AppsCmd extends Command {
@ -47,6 +47,7 @@ export default class AppsCmd extends Command {
public static flags: flags.Input<FlagsDef> = {
help: cf.help,
verbose: flags.boolean({
default: false,
char: 'v',
description: isV12()
? 'No-op since release v12.0.0'

View File

@ -160,6 +160,7 @@ export default class EnvsCmd extends Command {
...(isV12()
? {
all: flags.boolean({
default: false,
description: stripIndent`
No-op since balena CLI v12.0.0.`,
hidden: true,
@ -167,6 +168,7 @@ export default class EnvsCmd extends Command {
}
: {
all: flags.boolean({
default: false,
description: stripIndent`
include app-wide, device-wide variables that apply to the selected device or service.
Variables are still filtered out by type with the --config option.`,
@ -174,6 +176,7 @@ export default class EnvsCmd extends Command {
}),
application: { exclusive: ['device'], ...cf.application },
config: flags.boolean({
default: false,
char: 'c',
description: 'show configuration variables only',
exclusive: ['service'],
@ -181,6 +184,7 @@ export default class EnvsCmd extends Command {
device: { exclusive: ['application'], ...cf.device },
help: cf.help,
json: flags.boolean({
default: false,
char: 'j',
description: 'produce JSON output instead of tabular output',
}),

View File

@ -72,16 +72,19 @@ export default class LoginCmd extends Command {
public static flags: flags.Input<FlagsDef> = {
web: flags.boolean({
default: false,
char: 'w',
description: 'web-based login',
exclusive: ['token', 'credentials'],
}),
token: flags.boolean({
default: false,
char: 't',
description: 'session token or API key',
exclusive: ['web', 'credentials'],
}),
credentials: flags.boolean({
default: false,
char: 'c',
description: 'credential-based login',
exclusive: ['web', 'token'],

View File

@ -76,6 +76,7 @@ export default class LogsCmd extends Command {
public static flags: flags.Input<FlagsDef> = {
tail: flags.boolean({
default: false,
description: 'continuously stream output',
char: 't',
}),
@ -87,6 +88,7 @@ export default class LogsCmd extends Command {
multiple: true,
}),
system: flags.boolean({
default: false,
description:
'Only show system logs. This can be used in combination with --service.',
char: 'S',

View File

@ -100,10 +100,12 @@ manually pinned using https://github.com/balena-io-projects/staged-releases .\
char: 's',
}),
'dont-check-arch': flags.boolean({
default: false,
description:
'disables check for matching architecture in image and application',
}),
'pin-device-to-release': flags.boolean({
default: false,
description:
'pin the preloaded device to the preloaded release on provision',
char: 'p',

View File

@ -50,8 +50,8 @@ export default class ScanCmd extends Command {
public static flags: flags.Input<FlagsDef> = {
verbose: flags.boolean({
char: 'v',
default: false,
char: 'v',
description: 'display full info',
}),
timeout: flags.integer({
@ -60,6 +60,7 @@ export default class ScanCmd extends Command {
}),
help: cf.help,
json: flags.boolean({
default: false,
char: 'j',
description: 'produce JSON output instead of tabular output',
}),

View File

@ -102,15 +102,18 @@ export default class NoteCmd extends Command {
parse: (p) => parseAsInteger(p, 'port'),
}),
tty: flags.boolean({
default: false,
description:
'Force pseudo-terminal allocation (bypass TTY autodetection for stdin)',
char: 't',
}),
verbose: flags.boolean({
default: false,
description: 'Increase verbosity',
char: 'v',
}),
noproxy: flags.boolean({
default: false,
description: 'Bypass global proxy configuration for the ssh connection',
}),
help: cf.help,

View File

@ -20,8 +20,8 @@ import Command from '../command';
import { stripIndent } from '../utils/lazy';
interface FlagsDef {
all?: boolean;
json?: boolean;
all: boolean;
json: boolean;
help: void;
}
@ -59,14 +59,14 @@ export default class VersionCmd extends Command {
public static flags: flags.Input<FlagsDef> = {
all: flags.boolean({
char: 'a',
default: false,
char: 'a',
description:
'include version information for additional components (Node.js)',
}),
json: flags.boolean({
char: 'j',
default: false,
char: 'j',
description:
'output version information in JSON format for programmatic use',
}),