Drop -h flag for help and stop manually adding help per command in favor of oclif automatically adding it

Change-type: major
This commit is contained in:
myarmolinsky 2024-09-30 12:05:32 -04:00
parent de1821d7ac
commit d023d0af91
89 changed files with 9 additions and 316 deletions

View File

@ -29,7 +29,7 @@ _balena() {
_arguments -C \
'(- 1 *)--version[show version and exit]' \
'(- 1 *)'{-h,--help}'[show help options and exit]' \
'(- 1 *)--help[show help options and exit]' \
'1:first command:_balena_main_cmds' \
'2:second command:_balena_sec_cmds' \
&& ret=0

View File

@ -14,7 +14,7 @@ $sub_cmds$
_arguments -C \
'(- 1 *)--version[show version and exit]' \
'(- 1 *)'{-h,--help}'[show help options and exit]' \
'(- 1 *)--help[show help options and exit]' \
'1:first command:_balena_main_cmds' \
'2:second command:_balena_sec_cmds' \
&& ret=0

View File

@ -333,8 +333,6 @@ Examples:
the API key name
### Options
## api-key list
### Aliases
@ -384,8 +382,6 @@ Examples:
the API key ids
### Options
# Apps
## app create
@ -1346,8 +1342,6 @@ Examples:
the uuid of the device to identify
### Options
## device
### Description
@ -1749,8 +1743,6 @@ the uuid of the device to pin to a release
the commit of the release for the device to get pinned to
### Options
## device public-url
### Description
@ -1807,8 +1799,6 @@ Examples:
comma-separated list (no blank spaces) of device UUIDs
### Options
## device reboot
### Description
@ -1895,8 +1885,6 @@ the uuid of the device to rename
the new name for the device
### Options
## device restart
### Description
@ -2076,8 +2064,6 @@ comma-separated list (no blank spaces) of device UUIDs
comma-separated list (no blank spaces) of service names
### Options
## device stop-service
### Description
@ -2102,8 +2088,6 @@ comma-separated list (no blank spaces) of device UUIDs
comma-separated list (no blank spaces) of service names
### Options
## device track-fleet
### Description
@ -2120,8 +2104,6 @@ Examples:
the uuid of the device to make track the fleet's release
### Options
## device tunnel
### Aliases
@ -2618,8 +2600,6 @@ the slug of the fleet to pin to a release
the commit of the release for the fleet to get pinned to
### Options
## fleet purge
### Description
@ -2648,8 +2628,6 @@ Examples:
fleet name or slug (preferred)
### Options
## fleet rename
### Description
@ -2685,8 +2663,6 @@ fleet name or slug (preferred)
the new name for the fleet
### Options
## fleet restart
### Description
@ -2714,8 +2690,6 @@ Examples:
fleet name or slug (preferred)
### Options
## fleet rm
### Description
@ -2769,8 +2743,6 @@ Examples:
the slug of the fleet to make track the latest release
### Options
# Local
## local configure
@ -2790,8 +2762,6 @@ Examples:
path of drive or image to configure
### Options
## local flash
### Description
@ -2845,8 +2815,6 @@ Examples:
$ balena organization list
### Options
# OS
## os build-config
@ -3217,8 +3185,6 @@ Examples:
the device IP or hostname
### Options
# Preload
## preload
@ -3586,8 +3552,6 @@ Examples:
the commit or ID of the release to finalize
### Options
## release
### Description
@ -3641,8 +3605,6 @@ Examples:
the commit or ID of the release to invalidate
### Options
## release list
### Aliases
@ -3708,8 +3670,6 @@ Examples:
the commit or ID of the release to validate
### Options
# Settings
## settings
@ -3722,8 +3682,6 @@ Examples:
$ balena settings
### Options
# SSH Keys
## ssh-key add
@ -3772,8 +3730,6 @@ the SSH key name
the path to the public key file
### Options
## ssh-key
### Aliases
@ -3797,8 +3753,6 @@ Examples:
balenaCloud ID for the SSH key
### Options
## ssh-key list
### Aliases
@ -3817,8 +3771,6 @@ Examples:
$ balena ssh-key list
### Options
## ssh-key rm
### Aliases
@ -4058,8 +4010,6 @@ release id
List available drives which are usable for writing an OS image to.
Does not list system drives.
### Options
# Version
## version

View File

@ -17,7 +17,6 @@
import { Args, Command } from '@oclif/core';
import { ExpectedError } from '../../errors';
import * as cf from '../../utils/common-flags';
import { getBalenaSdk, stripIndent } from '../../utils/lazy';
export default class GenerateCmd extends Command {
@ -39,10 +38,6 @@ export default class GenerateCmd extends Command {
}),
};
public static flags = {
help: cf.help,
};
public static authenticated = true;
public async run() {

View File

@ -33,7 +33,6 @@ export default class APIKeyListCmd extends Command {
public static examples = ['$ balena api-key list'];
public static flags = {
help: cf.help,
user: Flags.boolean({
char: 'u',
description: 'show API keys for your user',

View File

@ -16,7 +16,6 @@
*/
import { Args, Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import { getBalenaSdk, stripIndent } from '../../utils/lazy';
export default class RevokeCmd extends Command {
@ -40,10 +39,6 @@ export default class RevokeCmd extends Command {
}),
};
public static flags = {
help: cf.help,
};
public static authenticated = true;
public async run() {

View File

@ -16,7 +16,6 @@
*/
import { Flags, Args, Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import { stripIndent } from '../../utils/lazy';
export default class AppCreateCmd extends Command {
@ -64,7 +63,6 @@ export default class AppCreateCmd extends Command {
description:
'app device type (Check available types with `balena device-type list`)',
}),
help: cf.help,
};
public static authenticated = true;

View File

@ -16,7 +16,6 @@
*/
import { Flags, Args, Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import { stripIndent } from '../../utils/lazy';
export default class BlockCreateCmd extends Command {
@ -64,7 +63,6 @@ export default class BlockCreateCmd extends Command {
description:
'block device type (Check available types with `balena device-type list`)',
}),
help: cf.help,
};
public static authenticated = true;

View File

@ -44,7 +44,6 @@ interface FlagsDef extends ComposeCliFlags, DockerCliFlags {
deviceType?: string;
fleet?: string;
source?: string; // Not part of command profile - source param copied here.
help: void;
}
export default class BuildCmd extends Command {
@ -95,9 +94,6 @@ ${dockerignoreHelp}
fleet: cf.fleet,
...composeCliFlags,
...dockerCliFlags,
// NOTE: Not supporting -h for help, because of clash with -h in DockerCliFlags
// Revisit this in future release.
help: Flags.help({}),
};
public static primary = true;

View File

@ -117,7 +117,6 @@ export default class ConfigGenerateCmd extends Command {
'expiry date assigned to generated provisioning api key (format: YYYY-MM-DD)',
exclusive: ['device'],
}),
help: cf.help,
};
public static authenticated = true;

View File

@ -44,7 +44,6 @@ export default class ConfigInjectCmd extends Command {
public static flags = {
drive: cf.driveOrImg,
help: cf.help,
};
public static root = true;

View File

@ -38,7 +38,6 @@ export default class ConfigReadCmd extends Command {
public static flags = {
drive: cf.driveOrImg,
help: cf.help,
json: cf.json,
};

View File

@ -44,7 +44,6 @@ export default class ConfigReconfigureCmd extends Command {
description: 'show advanced commands',
char: 'v',
}),
help: cf.help,
version: Flags.string({
description: 'balenaOS version, for example "2.32.0" or "2.44.0+rev1"',
}),

View File

@ -49,7 +49,6 @@ export default class ConfigWriteCmd extends Command {
public static flags = {
drive: cf.driveOrImg,
help: cf.help,
};
public static root = true;

View File

@ -60,7 +60,6 @@ interface FlagsDef extends ComposeCliFlags, DockerCliFlags {
'release-tag'?: string[];
draft: boolean;
note?: string;
help: void;
}
export default class DeployCmd extends Command {
@ -139,9 +138,6 @@ ${dockerignoreHelp}
note: Flags.string({ description: 'The notes for this release' }),
...composeCliFlags,
...dockerCliFlags,
// NOTE: Not supporting -h for help, because of clash with -h in DockerCliFlags
// Revisit this in future release.
help: Flags.help({}),
};
public static authenticated = true;

View File

@ -17,7 +17,6 @@
import { Flags, Command } from '@oclif/core';
import type * as BalenaSdk from 'balena-sdk';
import * as _ from 'lodash';
import * as cf from '../../utils/common-flags';
import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy';
export default class DeviceTypeListCmd extends Command {
@ -46,7 +45,6 @@ export default class DeviceTypeListCmd extends Command {
];
public static flags = {
help: cf.help,
json: Flags.boolean({
char: 'j',
description: 'produce JSON output instead of tabular output',

View File

@ -42,7 +42,6 @@ export default class DeviceDeactivateCmd extends Command {
public static flags = {
yes: cf.yes,
help: cf.help,
};
public static authenticated = true;

View File

@ -16,7 +16,6 @@
*/
import { Flags, Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import { getCliUx, stripIndent } from '../../utils/lazy';
export default class DeviceDetectCmd extends Command {
@ -50,7 +49,6 @@ export default class DeviceDetectCmd extends Command {
char: 't',
description: 'scan timeout in seconds',
}),
help: cf.help,
json: Flags.boolean({
default: false,
char: 'j',

View File

@ -16,7 +16,6 @@
*/
import { Args, Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import { getBalenaSdk, stripIndent } from '../../utils/lazy';
import { ExpectedError } from '../../errors';
@ -35,10 +34,6 @@ export default class DeviceIdentifyCmd extends Command {
}),
};
public static flags = {
help: cf.help,
};
public static authenticated = true;
public async run() {

View File

@ -63,7 +63,6 @@ export default class DeviceCmd extends Command {
public static flags = {
json: cf.json,
help: cf.help,
view: Flags.boolean({
default: false,
description: 'open device dashboard page',

View File

@ -28,7 +28,6 @@ interface FlagsDef {
'os-version'?: string;
drive?: string;
config?: string;
help: void;
'provisioning-key-name'?: string;
'provisioning-key-expiry-date'?: string;
}
@ -100,7 +99,6 @@ export default class DeviceInitCmd extends Command {
description:
'expiry date assigned to generated provisioning api key (format: YYYY-MM-DD)',
}),
help: cf.help,
};
public static authenticated = true;

View File

@ -59,7 +59,6 @@ export default class DeviceListCmd extends Command {
public static flags = {
fleet: cf.fleet,
json: cf.json,
help: cf.help,
};
public static primary = true;

View File

@ -16,7 +16,6 @@
*/
import { Flags, Args, Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import { getBalenaSdk, stripIndent } from '../../utils/lazy';
export default class DeviceLocalModeCmd extends Command {
@ -54,7 +53,6 @@ export default class DeviceLocalModeCmd extends Command {
description: 'output boolean indicating local mode status',
exclusive: ['enable', 'disable'],
}),
help: cf.help,
};
public static authenticated = true;

View File

@ -16,7 +16,6 @@
*/
import { Flags, Args, Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import { getBalenaSdk, stripIndent } from '../../utils/lazy';
import type { LogMessage } from 'balena-sdk';
@ -87,7 +86,6 @@ export default class DeviceLogsCmd extends Command {
'Only show system logs. This can be used in combination with --service.',
char: 'S',
}),
help: cf.help,
};
public static primary = true;

View File

@ -55,7 +55,6 @@ export default class DeviceMoveCmd extends Command {
public static flags = {
fleet: cf.fleet,
help: cf.help,
};
public static authenticated = true;

View File

@ -50,7 +50,6 @@ export default class DeviceNoteCmd extends Command {
exclusive: ['device'],
hidden: true,
}),
help: cf.help,
};
public static authenticated = true;

View File

@ -57,7 +57,6 @@ export default class DeviceOsUpdateCmd extends Command {
exclusive: ['version'],
}),
yes: cf.yes,
help: cf.help,
};
public static authenticated = true;

View File

@ -16,7 +16,6 @@
*/
import { Args, Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import { getBalenaSdk, stripIndent } from '../../utils/lazy';
import { getExpandedProp } from '../../utils/pine';
@ -43,10 +42,6 @@ export default class DevicePinCmd extends Command {
}),
};
public static flags = {
help: cf.help,
};
public static authenticated = true;
public async run() {

View File

@ -17,7 +17,6 @@
import { Flags, Args, Command } from '@oclif/core';
import { ExpectedError } from '../../errors';
import * as cf from '../../utils/common-flags';
import { getBalenaSdk, stripIndent } from '../../utils/lazy';
export default class DevicePublicUrlCmd extends Command {
@ -56,7 +55,6 @@ export default class DevicePublicUrlCmd extends Command {
description: 'determine if public URL is enabled',
exclusive: ['enable', 'disable'],
}),
help: cf.help,
};
public static authenticated = true;

View File

@ -16,7 +16,6 @@
*/
import { Args, Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import { getBalenaSdk, getCliUx, stripIndent } from '../../utils/lazy';
export default class DevicePurgeCmd extends Command {
@ -41,10 +40,6 @@ export default class DevicePurgeCmd extends Command {
}),
};
public static flags = {
help: cf.help,
};
public static authenticated = true;
public async run() {

View File

@ -36,7 +36,6 @@ export default class DeviceRebootCmd extends Command {
public static flags = {
force: cf.force,
help: cf.help,
};
public static authenticated = true;

View File

@ -16,7 +16,6 @@
*/
import { Flags, Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import * as ca from '../../utils/common-args';
import { getBalenaSdk, stripIndent } from '../../utils/lazy';
import { applicationIdInfo } from '../../utils/messages';
@ -52,7 +51,6 @@ export default class DeviceRegisterCmd extends Command {
description:
"device type slug (run 'balena device-type list' for possible values)",
}),
help: cf.help,
};
public static authenticated = true;

View File

@ -16,7 +16,6 @@
*/
import { Args, Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import { getBalenaSdk, stripIndent, getCliForm } from '../../utils/lazy';
export default class DeviceRenameCmd extends Command {
@ -42,10 +41,6 @@ export default class DeviceRenameCmd extends Command {
}),
};
public static flags = {
help: cf.help,
};
public static authenticated = true;
public async run() {

View File

@ -16,7 +16,6 @@
*/
import { Flags, Args, Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import { getBalenaSdk, getCliUx, stripIndent } from '../../utils/lazy';
import type {
BalenaSDK,
@ -58,7 +57,6 @@ export default class DeviceRestartCmd extends Command {
'comma-separated list (no blank spaces) of service names to restart',
char: 's',
}),
help: cf.help,
};
public static authenticated = true;

View File

@ -44,7 +44,6 @@ export default class DeviceRmCmd extends Command {
public static flags = {
yes: cf.yes,
help: cf.help,
};
public static authenticated = true;

View File

@ -37,7 +37,6 @@ export default class DeviceShutdownCmd extends Command {
public static flags = {
force: cf.force,
help: cf.help,
};
public static authenticated = true;

View File

@ -16,7 +16,6 @@
*/
import { Flags, Args, Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import { getBalenaSdk, stripIndent } from '../../utils/lazy';
import {
parseAsInteger,
@ -100,7 +99,6 @@ export default class DeviceSSHCmd extends Command {
default: false,
description: 'bypass global proxy configuration for the ssh connection',
}),
help: cf.help,
};
public static primary = true;

View File

@ -16,7 +16,6 @@
*/
import { Args, Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import { getBalenaSdk, getCliUx, stripIndent } from '../../utils/lazy';
import type { BalenaSDK } from 'balena-sdk';
@ -45,10 +44,6 @@ export default class DeviceStartServiceCmd extends Command {
}),
};
public static flags = {
help: cf.help,
};
public static authenticated = true;
public async run() {

View File

@ -16,7 +16,6 @@
*/
import { Args, Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import { getBalenaSdk, getCliUx, stripIndent } from '../../utils/lazy';
import type { BalenaSDK } from 'balena-sdk';
@ -45,10 +44,6 @@ export default class DeviceStopServiceCmd extends Command {
}),
};
public static flags = {
help: cf.help,
};
public static authenticated = true;
public async run() {

View File

@ -16,7 +16,6 @@
*/
import { Args, Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import { getBalenaSdk, stripIndent } from '../../utils/lazy';
export default class DeviceTrackFleetCmd extends Command {
@ -34,10 +33,6 @@ export default class DeviceTrackFleetCmd extends Command {
}),
};
public static flags = {
help: cf.help,
};
public static authenticated = true;
public async run() {

View File

@ -21,7 +21,6 @@ import {
InvalidPortMappingError,
ExpectedError,
} from '../../errors';
import * as cf from '../../utils/common-flags';
import { getBalenaSdk, stripIndent } from '../../utils/lazy';
import { lowercaseIfSlug } from '../../utils/normalization';
@ -87,7 +86,6 @@ export default class DeviceTunnelCmd extends Command {
char: 'p',
multiple: true,
}),
help: cf.help,
};
public static primary = true;

View File

@ -105,7 +105,6 @@ export default class EnvListCmd extends Command {
exclusive: ['service'],
}),
device: { ...cf.device, exclusive: ['fleet'] },
help: cf.help,
json: cf.json,
service: { ...cf.service, exclusive: ['config'] },
};

View File

@ -15,7 +15,6 @@
* limitations under the License.
*/
import { Args, Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import * as ec from '../../utils/env-common';
import { getBalenaSdk, stripIndent } from '../../utils/lazy';
import { parseAsInteger } from '../../utils/validation';
@ -55,7 +54,6 @@ export default class EnvRenameCmd extends Command {
config: ec.booleanConfig,
device: ec.booleanDevice,
service: ec.booleanService,
help: cf.help,
};
public async run() {

View File

@ -25,7 +25,6 @@ import { applicationIdInfo } from '../../utils/messages';
interface FlagsDef {
fleet?: string;
device?: string; // device UUID
help: void;
quiet: boolean;
service?: string; // service name
}
@ -98,7 +97,6 @@ export default class EnvSetCmd extends Command {
public static flags = {
fleet: { ...cf.fleet, exclusive: ['device'] },
device: { ...cf.device, exclusive: ['fleet'] },
help: cf.help,
quiet: cf.quiet,
service: cf.service,
};

View File

@ -16,7 +16,6 @@
*/
import { Flags, Args, Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import { stripIndent } from '../../utils/lazy';
export default class FleetCreateCmd extends Command {
@ -64,7 +63,6 @@ export default class FleetCreateCmd extends Command {
description:
'fleet device type (Check available types with `balena device-type list`)',
}),
help: cf.help,
};
public static authenticated = true;

View File

@ -40,7 +40,6 @@ export default class FleetCmd extends Command {
};
public static flags = {
help: cf.help,
view: Flags.boolean({
default: false,
description: 'open fleet dashboard page',

View File

@ -42,7 +42,6 @@ export default class FleetListCmd extends Command {
public static examples = ['$ balena fleet list'];
public static flags = {
help: cf.help,
json: cf.json,
};

View File

@ -16,7 +16,6 @@
*/
import { Args, Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import { getBalenaSdk, stripIndent } from '../../utils/lazy';
import { getExpandedProp } from '../../utils/pine';
@ -43,10 +42,6 @@ export default class FleetPinCmd extends Command {
}),
};
public static flags = {
help: cf.help,
};
public static authenticated = true;
public async run() {

View File

@ -16,7 +16,6 @@
*/
import { Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import * as ca from '../../utils/common-args';
import { getBalenaSdk, stripIndent } from '../../utils/lazy';
import { applicationIdInfo } from '../../utils/messages';
@ -40,10 +39,6 @@ export default class FleetPurgeCmd extends Command {
fleet: ca.fleetRequired,
};
public static flags = {
help: cf.help,
};
public static authenticated = true;
public async run() {

View File

@ -16,7 +16,6 @@
*/
import { Args, Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import * as ca from '../../utils/common-args';
import { getBalenaSdk, stripIndent, getCliForm } from '../../utils/lazy';
import { applicationIdInfo } from '../../utils/messages';
@ -46,10 +45,6 @@ export default class FleetRenameCmd extends Command {
}),
};
public static flags = {
help: cf.help,
};
public static authenticated = true;
public async run() {

View File

@ -16,7 +16,6 @@
*/
import { Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import * as ca from '../../utils/common-args';
import { getBalenaSdk, stripIndent } from '../../utils/lazy';
import { applicationIdInfo } from '../../utils/messages';
@ -39,10 +38,6 @@ export default class FleetRestartCmd extends Command {
fleet: ca.fleetRequired,
};
public static flags = {
help: cf.help,
};
public static authenticated = true;
public async run() {

View File

@ -44,7 +44,6 @@ export default class FleetRmCmd extends Command {
public static flags = {
yes: cf.yes,
help: cf.help,
};
public static authenticated = true;

View File

@ -16,7 +16,6 @@
*/
import { Args, Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import { getBalenaSdk, stripIndent } from '../../utils/lazy';
export default class FleetTrackLatestCmd extends Command {
@ -37,10 +36,6 @@ export default class FleetTrackLatestCmd extends Command {
}),
};
public static flags = {
help: cf.help,
};
public static authenticated = true;
public async run() {

View File

@ -65,7 +65,6 @@ export default class JoinCmd extends Command {
description: 'the interval in minutes to check for updates',
char: 'i',