From 3af04f52fa2ead548670ea425267234034802e69 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Mon, 30 Sep 2024 12:05:32 -0400 Subject: [PATCH] Drop `-h` flag for help and stop manually adding `help` per command in favor of oclif automatically adding it Change-type: major --- completion/_balena | 2 +- completion/templates/zsh.template | 2 +- docs/balena-cli.md | 50 ------------------------- src/commands/api-key/generate.ts | 5 --- src/commands/api-key/list.ts | 1 - src/commands/api-key/revoke.ts | 5 --- src/commands/app/create.ts | 2 - src/commands/block/create.ts | 2 - src/commands/build/index.ts | 4 -- src/commands/config/generate.ts | 1 - src/commands/config/inject.ts | 1 - src/commands/config/read.ts | 1 - src/commands/config/reconfigure.ts | 1 - src/commands/config/write.ts | 1 - src/commands/deploy/index.ts | 4 -- src/commands/device-type/list.ts | 2 - src/commands/device/deactivate.ts | 1 - src/commands/device/detect.ts | 2 - src/commands/device/identify.ts | 5 --- src/commands/device/index.ts | 1 - src/commands/device/init.ts | 2 - src/commands/device/list.ts | 1 - src/commands/device/local-mode.ts | 2 - src/commands/device/logs.ts | 2 - src/commands/device/move.ts | 1 - src/commands/device/note.ts | 1 - src/commands/device/os-update.ts | 1 - src/commands/device/pin.ts | 5 --- src/commands/device/public-url.ts | 2 - src/commands/device/purge.ts | 5 --- src/commands/device/reboot.ts | 1 - src/commands/device/register.ts | 2 - src/commands/device/rename.ts | 5 --- src/commands/device/restart.ts | 2 - src/commands/device/rm.ts | 1 - src/commands/device/shutdown.ts | 1 - src/commands/device/ssh.ts | 2 - src/commands/device/start-service.ts | 5 --- src/commands/device/stop-service.ts | 5 --- src/commands/device/track-fleet.ts | 5 --- src/commands/device/tunnel.ts | 2 - src/commands/env/list.ts | 1 - src/commands/env/rename.ts | 2 - src/commands/env/set.ts | 2 - src/commands/fleet/create.ts | 2 - src/commands/fleet/index.ts | 1 - src/commands/fleet/list.ts | 1 - src/commands/fleet/pin.ts | 5 --- src/commands/fleet/purge.ts | 5 --- src/commands/fleet/rename.ts | 5 --- src/commands/fleet/restart.ts | 5 --- src/commands/fleet/rm.ts | 1 - src/commands/fleet/track-latest.ts | 5 --- src/commands/join/index.ts | 1 - src/commands/leave/index.ts | 5 --- src/commands/local/configure.ts | 5 --- src/commands/local/flash.ts | 1 - src/commands/login/index.ts | 3 -- src/commands/organization/list.ts | 5 --- src/commands/os/build-config.ts | 2 - src/commands/os/configure.ts | 1 - src/commands/os/download.ts | 2 - src/commands/os/initialize.ts | 1 - src/commands/os/versions.ts | 2 - src/commands/preload/index.ts | 3 -- src/commands/push/index.ts | 2 - src/commands/release/finalize.ts | 5 --- src/commands/release/index.ts | 1 - src/commands/release/invalidate.ts | 5 --- src/commands/release/list.ts | 1 - src/commands/release/validate.ts | 5 --- src/commands/settings/index.ts | 5 --- src/commands/ssh-key/add.ts | 5 --- src/commands/ssh-key/index.ts | 5 --- src/commands/ssh-key/list.ts | 5 --- src/commands/ssh-key/rm.ts | 1 - src/commands/support/index.ts | 1 - src/commands/tag/list.ts | 1 - src/commands/tag/rm.ts | 1 - src/commands/tag/set.ts | 1 - src/commands/util/available-drives.ts | 5 --- src/commands/version/index.ts | 1 - src/help.ts | 4 +- src/preparser.ts | 4 +- src/utils/application-create.ts | 1 - src/utils/common-flags.ts | 2 - tests/commands/app/create.spec.ts | 46 ----------------------- tests/commands/device-type/list.spec.ts | 4 +- tests/commands/help.spec.ts | 2 +- 89 files changed, 9 insertions(+), 316 deletions(-) delete mode 100644 tests/commands/app/create.spec.ts diff --git a/completion/_balena b/completion/_balena index 0058ceab..9daf9928 100644 --- a/completion/_balena +++ b/completion/_balena @@ -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 diff --git a/completion/templates/zsh.template b/completion/templates/zsh.template index 4676869f..d5762146 100644 --- a/completion/templates/zsh.template +++ b/completion/templates/zsh.template @@ -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 diff --git a/docs/balena-cli.md b/docs/balena-cli.md index 80544ea4..3d5c2f49 100644 --- a/docs/balena-cli.md +++ b/docs/balena-cli.md @@ -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 diff --git a/src/commands/api-key/generate.ts b/src/commands/api-key/generate.ts index e869358d..1eb381de 100644 --- a/src/commands/api-key/generate.ts +++ b/src/commands/api-key/generate.ts @@ -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() { diff --git a/src/commands/api-key/list.ts b/src/commands/api-key/list.ts index 2bb69013..8f802ff7 100644 --- a/src/commands/api-key/list.ts +++ b/src/commands/api-key/list.ts @@ -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', diff --git a/src/commands/api-key/revoke.ts b/src/commands/api-key/revoke.ts index a8c4756b..ef303d68 100644 --- a/src/commands/api-key/revoke.ts +++ b/src/commands/api-key/revoke.ts @@ -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() { diff --git a/src/commands/app/create.ts b/src/commands/app/create.ts index 67242d30..7ca52f77 100644 --- a/src/commands/app/create.ts +++ b/src/commands/app/create.ts @@ -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; diff --git a/src/commands/block/create.ts b/src/commands/block/create.ts index 0e69b6cc..221f7d2a 100644 --- a/src/commands/block/create.ts +++ b/src/commands/block/create.ts @@ -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; diff --git a/src/commands/build/index.ts b/src/commands/build/index.ts index fd0c9940..66a8944f 100644 --- a/src/commands/build/index.ts +++ b/src/commands/build/index.ts @@ -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; diff --git a/src/commands/config/generate.ts b/src/commands/config/generate.ts index ee95a0c7..4376b53f 100644 --- a/src/commands/config/generate.ts +++ b/src/commands/config/generate.ts @@ -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; diff --git a/src/commands/config/inject.ts b/src/commands/config/inject.ts index f34e71d0..a9d06cb1 100644 --- a/src/commands/config/inject.ts +++ b/src/commands/config/inject.ts @@ -44,7 +44,6 @@ export default class ConfigInjectCmd extends Command { public static flags = { drive: cf.driveOrImg, - help: cf.help, }; public static root = true; diff --git a/src/commands/config/read.ts b/src/commands/config/read.ts index d32b511d..644f68f1 100644 --- a/src/commands/config/read.ts +++ b/src/commands/config/read.ts @@ -38,7 +38,6 @@ export default class ConfigReadCmd extends Command { public static flags = { drive: cf.driveOrImg, - help: cf.help, json: cf.json, }; diff --git a/src/commands/config/reconfigure.ts b/src/commands/config/reconfigure.ts index 24003f8e..af01e959 100644 --- a/src/commands/config/reconfigure.ts +++ b/src/commands/config/reconfigure.ts @@ -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"', }), diff --git a/src/commands/config/write.ts b/src/commands/config/write.ts index 34cd3b8b..4a8d991c 100644 --- a/src/commands/config/write.ts +++ b/src/commands/config/write.ts @@ -49,7 +49,6 @@ export default class ConfigWriteCmd extends Command { public static flags = { drive: cf.driveOrImg, - help: cf.help, }; public static root = true; diff --git a/src/commands/deploy/index.ts b/src/commands/deploy/index.ts index 1e87ad74..312edfb4 100644 --- a/src/commands/deploy/index.ts +++ b/src/commands/deploy/index.ts @@ -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; diff --git a/src/commands/device-type/list.ts b/src/commands/device-type/list.ts index 2e50b4fe..ff3d5dcc 100644 --- a/src/commands/device-type/list.ts +++ b/src/commands/device-type/list.ts @@ -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', diff --git a/src/commands/device/deactivate.ts b/src/commands/device/deactivate.ts index e8e50611..f0a81631 100644 --- a/src/commands/device/deactivate.ts +++ b/src/commands/device/deactivate.ts @@ -42,7 +42,6 @@ export default class DeviceDeactivateCmd extends Command { public static flags = { yes: cf.yes, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/device/detect.ts b/src/commands/device/detect.ts index 79605016..c8489c42 100644 --- a/src/commands/device/detect.ts +++ b/src/commands/device/detect.ts @@ -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', diff --git a/src/commands/device/identify.ts b/src/commands/device/identify.ts index 57bef0af..c3de3cec 100644 --- a/src/commands/device/identify.ts +++ b/src/commands/device/identify.ts @@ -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() { diff --git a/src/commands/device/index.ts b/src/commands/device/index.ts index 86e2c0a0..53e6c7bb 100644 --- a/src/commands/device/index.ts +++ b/src/commands/device/index.ts @@ -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', diff --git a/src/commands/device/init.ts b/src/commands/device/init.ts index 7ad58e24..81b907f4 100644 --- a/src/commands/device/init.ts +++ b/src/commands/device/init.ts @@ -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; diff --git a/src/commands/device/list.ts b/src/commands/device/list.ts index a30e4710..7eea1c1e 100644 --- a/src/commands/device/list.ts +++ b/src/commands/device/list.ts @@ -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; diff --git a/src/commands/device/local-mode.ts b/src/commands/device/local-mode.ts index e26ae15d..7d327336 100644 --- a/src/commands/device/local-mode.ts +++ b/src/commands/device/local-mode.ts @@ -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; diff --git a/src/commands/device/logs.ts b/src/commands/device/logs.ts index 12d93851..b08d81e1 100644 --- a/src/commands/device/logs.ts +++ b/src/commands/device/logs.ts @@ -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; diff --git a/src/commands/device/move.ts b/src/commands/device/move.ts index 93393b32..0300fe70 100644 --- a/src/commands/device/move.ts +++ b/src/commands/device/move.ts @@ -55,7 +55,6 @@ export default class DeviceMoveCmd extends Command { public static flags = { fleet: cf.fleet, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/device/note.ts b/src/commands/device/note.ts index 3e0b3f83..cedbdb81 100644 --- a/src/commands/device/note.ts +++ b/src/commands/device/note.ts @@ -50,7 +50,6 @@ export default class DeviceNoteCmd extends Command { exclusive: ['device'], hidden: true, }), - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/device/os-update.ts b/src/commands/device/os-update.ts index 665c5d87..580d2eef 100644 --- a/src/commands/device/os-update.ts +++ b/src/commands/device/os-update.ts @@ -57,7 +57,6 @@ export default class DeviceOsUpdateCmd extends Command { exclusive: ['version'], }), yes: cf.yes, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/device/pin.ts b/src/commands/device/pin.ts index cbe896de..b786ccb8 100644 --- a/src/commands/device/pin.ts +++ b/src/commands/device/pin.ts @@ -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() { diff --git a/src/commands/device/public-url.ts b/src/commands/device/public-url.ts index c1ff9bb5..52f7394b 100644 --- a/src/commands/device/public-url.ts +++ b/src/commands/device/public-url.ts @@ -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; diff --git a/src/commands/device/purge.ts b/src/commands/device/purge.ts index 00bd54d0..37cf4a5d 100644 --- a/src/commands/device/purge.ts +++ b/src/commands/device/purge.ts @@ -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() { diff --git a/src/commands/device/reboot.ts b/src/commands/device/reboot.ts index 2a7e0e90..9061b405 100644 --- a/src/commands/device/reboot.ts +++ b/src/commands/device/reboot.ts @@ -36,7 +36,6 @@ export default class DeviceRebootCmd extends Command { public static flags = { force: cf.force, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/device/register.ts b/src/commands/device/register.ts index cefea070..13c8be60 100644 --- a/src/commands/device/register.ts +++ b/src/commands/device/register.ts @@ -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; diff --git a/src/commands/device/rename.ts b/src/commands/device/rename.ts index 0f56b8d4..f087be80 100644 --- a/src/commands/device/rename.ts +++ b/src/commands/device/rename.ts @@ -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() { diff --git a/src/commands/device/restart.ts b/src/commands/device/restart.ts index 082ca041..f64d3bd5 100644 --- a/src/commands/device/restart.ts +++ b/src/commands/device/restart.ts @@ -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; diff --git a/src/commands/device/rm.ts b/src/commands/device/rm.ts index 1ce7434d..be387aa7 100644 --- a/src/commands/device/rm.ts +++ b/src/commands/device/rm.ts @@ -44,7 +44,6 @@ export default class DeviceRmCmd extends Command { public static flags = { yes: cf.yes, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/device/shutdown.ts b/src/commands/device/shutdown.ts index 79b1974e..a65d7d84 100644 --- a/src/commands/device/shutdown.ts +++ b/src/commands/device/shutdown.ts @@ -37,7 +37,6 @@ export default class DeviceShutdownCmd extends Command { public static flags = { force: cf.force, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/device/ssh.ts b/src/commands/device/ssh.ts index 0469e5fa..ca722ac5 100644 --- a/src/commands/device/ssh.ts +++ b/src/commands/device/ssh.ts @@ -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; diff --git a/src/commands/device/start-service.ts b/src/commands/device/start-service.ts index 5749c2a2..eba5c71e 100644 --- a/src/commands/device/start-service.ts +++ b/src/commands/device/start-service.ts @@ -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() { diff --git a/src/commands/device/stop-service.ts b/src/commands/device/stop-service.ts index 652d1ec4..22f46067 100644 --- a/src/commands/device/stop-service.ts +++ b/src/commands/device/stop-service.ts @@ -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() { diff --git a/src/commands/device/track-fleet.ts b/src/commands/device/track-fleet.ts index cbf976b2..f4612a97 100644 --- a/src/commands/device/track-fleet.ts +++ b/src/commands/device/track-fleet.ts @@ -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() { diff --git a/src/commands/device/tunnel.ts b/src/commands/device/tunnel.ts index a325d3f8..38d877ea 100644 --- a/src/commands/device/tunnel.ts +++ b/src/commands/device/tunnel.ts @@ -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; diff --git a/src/commands/env/list.ts b/src/commands/env/list.ts index 875014f4..42c122d5 100644 --- a/src/commands/env/list.ts +++ b/src/commands/env/list.ts @@ -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'] }, }; diff --git a/src/commands/env/rename.ts b/src/commands/env/rename.ts index dcdd59f4..e21e01d7 100644 --- a/src/commands/env/rename.ts +++ b/src/commands/env/rename.ts @@ -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() { diff --git a/src/commands/env/set.ts b/src/commands/env/set.ts index 6807579b..6ad8d6a0 100644 --- a/src/commands/env/set.ts +++ b/src/commands/env/set.ts @@ -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, }; diff --git a/src/commands/fleet/create.ts b/src/commands/fleet/create.ts index 2412ab59..ebb3cb35 100644 --- a/src/commands/fleet/create.ts +++ b/src/commands/fleet/create.ts @@ -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; diff --git a/src/commands/fleet/index.ts b/src/commands/fleet/index.ts index ebba3444..7080a697 100644 --- a/src/commands/fleet/index.ts +++ b/src/commands/fleet/index.ts @@ -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', diff --git a/src/commands/fleet/list.ts b/src/commands/fleet/list.ts index 5972dd93..49e84547 100644 --- a/src/commands/fleet/list.ts +++ b/src/commands/fleet/list.ts @@ -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, }; diff --git a/src/commands/fleet/pin.ts b/src/commands/fleet/pin.ts index 92a19057..e1665bef 100644 --- a/src/commands/fleet/pin.ts +++ b/src/commands/fleet/pin.ts @@ -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() { diff --git a/src/commands/fleet/purge.ts b/src/commands/fleet/purge.ts index a6601ff1..2bcd3966 100644 --- a/src/commands/fleet/purge.ts +++ b/src/commands/fleet/purge.ts @@ -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() { diff --git a/src/commands/fleet/rename.ts b/src/commands/fleet/rename.ts index cd99434c..a6e03a06 100644 --- a/src/commands/fleet/rename.ts +++ b/src/commands/fleet/rename.ts @@ -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() { diff --git a/src/commands/fleet/restart.ts b/src/commands/fleet/restart.ts index e81067b0..9a6c6c9d 100644 --- a/src/commands/fleet/restart.ts +++ b/src/commands/fleet/restart.ts @@ -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() { diff --git a/src/commands/fleet/rm.ts b/src/commands/fleet/rm.ts index c115f67f..c768b74d 100644 --- a/src/commands/fleet/rm.ts +++ b/src/commands/fleet/rm.ts @@ -44,7 +44,6 @@ export default class FleetRmCmd extends Command { public static flags = { yes: cf.yes, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/fleet/track-latest.ts b/src/commands/fleet/track-latest.ts index 588592ee..2547d9b2 100644 --- a/src/commands/fleet/track-latest.ts +++ b/src/commands/fleet/track-latest.ts @@ -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() { diff --git a/src/commands/join/index.ts b/src/commands/join/index.ts index 2e3ccc7f..5427cb57 100644 --- a/src/commands/join/index.ts +++ b/src/commands/join/index.ts @@ -65,7 +65,6 @@ export default class JoinCmd extends Command { description: 'the interval in minutes to check for updates', char: 'i', }), - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/leave/index.ts b/src/commands/leave/index.ts index 9ff81399..123631a8 100644 --- a/src/commands/leave/index.ts +++ b/src/commands/leave/index.ts @@ -16,7 +16,6 @@ */ import { Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { stripIndent } from '../../utils/lazy'; import { parseAsLocalHostnameOrIp } from '../../utils/validation'; @@ -49,10 +48,6 @@ export default class LeaveCmd extends Command { }), }; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public static primary = true; diff --git a/src/commands/local/configure.ts b/src/commands/local/configure.ts index 7e72fb60..1cdd244c 100644 --- a/src/commands/local/configure.ts +++ b/src/commands/local/configure.ts @@ -17,7 +17,6 @@ import { Args, Command } from '@oclif/core'; import { promisify } from 'util'; -import * as cf from '../../utils/common-flags'; import { stripIndent } from '../../utils/lazy'; export default class LocalConfigureCmd extends Command { @@ -39,10 +38,6 @@ export default class LocalConfigureCmd extends Command { }), }; - public static flags = { - help: cf.help, - }; - public static root = true; public static offlineCompatible = true; diff --git a/src/commands/local/flash.ts b/src/commands/local/flash.ts index 592e0993..89c097ef 100644 --- a/src/commands/local/flash.ts +++ b/src/commands/local/flash.ts @@ -48,7 +48,6 @@ export default class LocalFlashCmd extends Command { public static flags = { drive: cf.drive, yes: cf.yes, - help: cf.help, }; public static offlineCompatible = true; diff --git a/src/commands/login/index.ts b/src/commands/login/index.ts index 7fb7de77..34d7fbfb 100644 --- a/src/commands/login/index.ts +++ b/src/commands/login/index.ts @@ -16,7 +16,6 @@ */ import { Flags, Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent, getCliForm } from '../../utils/lazy'; import { ExpectedError } from '../../errors'; import type { WhoamiResult } from 'balena-sdk'; @@ -29,7 +28,6 @@ interface FlagsDef { user?: string; password?: string; port?: number; - help: void; hideExperimentalWarning: boolean; } @@ -111,7 +109,6 @@ export default class LoginCmd extends Command { default: false, description: 'Hides warning for experimental features', }), - help: cf.help, }; public static primary = true; diff --git a/src/commands/organization/list.ts b/src/commands/organization/list.ts index 34df0174..df252d83 100644 --- a/src/commands/organization/list.ts +++ b/src/commands/organization/list.ts @@ -16,7 +16,6 @@ */ import { Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy'; export default class OrganizationListCmd extends Command { @@ -30,10 +29,6 @@ export default class OrganizationListCmd extends Command { `; public static examples = ['$ balena organization list']; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public async run() { diff --git a/src/commands/os/build-config.ts b/src/commands/os/build-config.ts index caac821a..7a15613b 100644 --- a/src/commands/os/build-config.ts +++ b/src/commands/os/build-config.ts @@ -16,7 +16,6 @@ */ import { Flags, Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getCliForm, stripIndent } from '../../utils/lazy'; import * as _ from 'lodash'; import type { DeviceTypeJson } from 'balena-sdk'; @@ -55,7 +54,6 @@ export default class OsBuildConfigCmd extends Command { char: 'o', required: true, }), - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/os/configure.ts b/src/commands/os/configure.ts index cb9669ef..da497c36 100644 --- a/src/commands/os/configure.ts +++ b/src/commands/os/configure.ts @@ -154,7 +154,6 @@ export default class OsConfigureCmd extends Command { 'expiry date assigned to generated provisioning api key (format: YYYY-MM-DD)', exclusive: ['config', 'device'], }), - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/os/download.ts b/src/commands/os/download.ts index 00ae0787..4635fcdd 100644 --- a/src/commands/os/download.ts +++ b/src/commands/os/download.ts @@ -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 OsDownloadCmd extends Command { @@ -78,7 +77,6 @@ export default class OsDownloadCmd extends Command { or 'menu-esr' (interactive menu, ESR versions) `, }), - help: cf.help, }; public async run() { diff --git a/src/commands/os/initialize.ts b/src/commands/os/initialize.ts index 76c5063f..c6d4b52a 100644 --- a/src/commands/os/initialize.ts +++ b/src/commands/os/initialize.ts @@ -51,7 +51,6 @@ export default class OsInitializeCmd extends Command { type: cf.deviceType, drive: cf.drive, yes: cf.yes, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/os/versions.ts b/src/commands/os/versions.ts index bdd1c0b8..1937885b 100644 --- a/src/commands/os/versions.ts +++ b/src/commands/os/versions.ts @@ -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 OsVersionsCmd extends Command { @@ -40,7 +39,6 @@ export default class OsVersionsCmd extends Command { }; public static flags = { - help: cf.help, esr: Flags.boolean({ description: 'select balenaOS ESR versions', default: false, diff --git a/src/commands/preload/index.ts b/src/commands/preload/index.ts index 0d5205ca..0cdfc63b 100644 --- a/src/commands/preload/index.ts +++ b/src/commands/preload/index.ts @@ -128,9 +128,6 @@ Can be repeated to add multiple certificates.\ 'Docker daemon TCP port number (hint: 2375 for balena devices)', parse: async (p) => parseAsInteger(p, 'dockerPort'), }), - // Not supporting -h for help, because of clash with -h in DockerCliFlags - // Revisit this in future release. - help: Flags.help({}), }; public static authenticated = true; diff --git a/src/commands/push/index.ts b/src/commands/push/index.ts index 520c2511..2b8b6e72 100644 --- a/src/commands/push/index.ts +++ b/src/commands/push/index.ts @@ -17,7 +17,6 @@ import { Flags, Args, Command } from '@oclif/core'; import type { Interfaces } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; import { dockerignoreHelp, registrySecretsHelp } from '../../utils/messages'; import type { BalenaSDK } from 'balena-sdk'; @@ -218,7 +217,6 @@ export default class PushCmd extends Command { default: false, }), note: Flags.string({ description: 'The notes for this release' }), - help: cf.help, }; public static primary = true; diff --git a/src/commands/release/finalize.ts b/src/commands/release/finalize.ts index e1f6c229..20276e2e 100644 --- a/src/commands/release/finalize.ts +++ b/src/commands/release/finalize.ts @@ -17,7 +17,6 @@ import { Command } from '@oclif/core'; import { commitOrIdArg } from '.'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; export default class ReleaseFinalizeCmd extends Command { @@ -40,10 +39,6 @@ export default class ReleaseFinalizeCmd extends Command { '$ balena release finalize 1234567', ]; - public static flags = { - help: cf.help, - }; - public static args = { commitOrId: commitOrIdArg({ description: 'the commit or ID of the release to finalize', diff --git a/src/commands/release/index.ts b/src/commands/release/index.ts index 1b9db22e..0c6cc19a 100644 --- a/src/commands/release/index.ts +++ b/src/commands/release/index.ts @@ -43,7 +43,6 @@ export default class ReleaseCmd extends Command { public static flags = { json: cf.json, - help: cf.help, composition: Flags.boolean({ default: false, char: 'c', diff --git a/src/commands/release/invalidate.ts b/src/commands/release/invalidate.ts index 26cfee60..42f952c8 100644 --- a/src/commands/release/invalidate.ts +++ b/src/commands/release/invalidate.ts @@ -17,7 +17,6 @@ import { Command } from '@oclif/core'; import { commitOrIdArg } from '.'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; export default class ReleaseInvalidateCmd extends Command { @@ -35,10 +34,6 @@ export default class ReleaseInvalidateCmd extends Command { '$ balena release invalidate 1234567', ]; - public static flags = { - help: cf.help, - }; - public static args = { commitOrId: commitOrIdArg({ description: 'the commit or ID of the release to invalidate', diff --git a/src/commands/release/list.ts b/src/commands/release/list.ts index bd4584da..dace069e 100644 --- a/src/commands/release/list.ts +++ b/src/commands/release/list.ts @@ -42,7 +42,6 @@ export default class ReleaseListCmd extends Command { public static flags = { json: cf.json, - help: cf.help, }; public static args = { diff --git a/src/commands/release/validate.ts b/src/commands/release/validate.ts index 83c269da..83d3e9ab 100644 --- a/src/commands/release/validate.ts +++ b/src/commands/release/validate.ts @@ -17,7 +17,6 @@ import { Command } from '@oclif/core'; import { commitOrIdArg } from '.'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; export default class ReleaseValidateCmd extends Command { @@ -34,10 +33,6 @@ export default class ReleaseValidateCmd extends Command { '$ balena release validate 1234567', ]; - public static flags = { - help: cf.help, - }; - public static args = { commitOrId: commitOrIdArg({ description: 'the commit or ID of the release to validate', diff --git a/src/commands/settings/index.ts b/src/commands/settings/index.ts index f5ca58f0..6dfaa5bc 100644 --- a/src/commands/settings/index.ts +++ b/src/commands/settings/index.ts @@ -16,7 +16,6 @@ */ import { Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; export default class SettingsCmd extends Command { @@ -27,10 +26,6 @@ export default class SettingsCmd extends Command { `; public static examples = ['$ balena settings']; - public static flags = { - help: cf.help, - }; - public async run() { await this.parse(SettingsCmd); diff --git a/src/commands/ssh-key/add.ts b/src/commands/ssh-key/add.ts index 59532fc9..4180792b 100644 --- a/src/commands/ssh-key/add.ts +++ b/src/commands/ssh-key/add.ts @@ -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 SSHKeyAddCmd extends Command { @@ -63,10 +62,6 @@ export default class SSHKeyAddCmd extends Command { }), }; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public async run() { diff --git a/src/commands/ssh-key/index.ts b/src/commands/ssh-key/index.ts index 79a97036..bb8ca1f8 100644 --- a/src/commands/ssh-key/index.ts +++ b/src/commands/ssh-key/index.ts @@ -16,7 +16,6 @@ */ import { Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy'; import { parseAsInteger } from '../../utils/validation'; @@ -40,10 +39,6 @@ export default class SSHKeyCmd extends Command { }), }; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public async run() { diff --git a/src/commands/ssh-key/list.ts b/src/commands/ssh-key/list.ts index 549be44a..d081e640 100644 --- a/src/commands/ssh-key/list.ts +++ b/src/commands/ssh-key/list.ts @@ -16,7 +16,6 @@ */ import { Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy'; export default class SSHKeyListCmd extends Command { @@ -30,10 +29,6 @@ export default class SSHKeyListCmd extends Command { `; public static examples = ['$ balena ssh-key list']; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public async run() { diff --git a/src/commands/ssh-key/rm.ts b/src/commands/ssh-key/rm.ts index 7cbcee7b..273cfa94 100644 --- a/src/commands/ssh-key/rm.ts +++ b/src/commands/ssh-key/rm.ts @@ -47,7 +47,6 @@ export default class SSHKeyRmCmd extends Command { public static flags = { yes: cf.yes, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/support/index.ts b/src/commands/support/index.ts index 50d4e420..6c100a24 100644 --- a/src/commands/support/index.ts +++ b/src/commands/support/index.ts @@ -66,7 +66,6 @@ export default class SupportCmd extends Command { 'length of time to enable support for, in (h)ours or (d)ays, e.g. 12h, 2d', char: 't', }), - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/tag/list.ts b/src/commands/tag/list.ts index 07c3daeb..40ca940e 100644 --- a/src/commands/tag/list.ts +++ b/src/commands/tag/list.ts @@ -54,7 +54,6 @@ export default class TagListCmd extends Command { ...cf.release, exclusive: ['fleet', 'device'], }, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/tag/rm.ts b/src/commands/tag/rm.ts index 3c1585cc..622b6f35 100644 --- a/src/commands/tag/rm.ts +++ b/src/commands/tag/rm.ts @@ -57,7 +57,6 @@ export default class TagRmCmd extends Command { ...cf.release, exclusive: ['fleet', 'device'], }, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/tag/set.ts b/src/commands/tag/set.ts index 60575a32..adb79a1e 100644 --- a/src/commands/tag/set.ts +++ b/src/commands/tag/set.ts @@ -71,7 +71,6 @@ export default class TagSetCmd extends Command { ...cf.release, exclusive: ['fleet', 'device'], }, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/util/available-drives.ts b/src/commands/util/available-drives.ts index 3de865cf..d4742718 100644 --- a/src/commands/util/available-drives.ts +++ b/src/commands/util/available-drives.ts @@ -16,7 +16,6 @@ */ import { Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { stripIndent, getChalk, getVisuals } from '../../utils/lazy'; export default class UtilAvailableDrivesCmd extends Command { @@ -27,10 +26,6 @@ export default class UtilAvailableDrivesCmd extends Command { Does not list system drives. `; - public static flags = { - help: cf.help, - }; - public static offlineCompatible = true; public async run() { diff --git a/src/commands/version/index.ts b/src/commands/version/index.ts index c7f5919c..2624b2e5 100644 --- a/src/commands/version/index.ts +++ b/src/commands/version/index.ts @@ -63,7 +63,6 @@ export default class VersionCmd extends Command { description: 'output version information in JSON format for programmatic use', }), - help: Flags.help({ char: 'h' }), }; public async run() { diff --git a/src/help.ts b/src/help.ts index 85e7fd51..16b75391 100644 --- a/src/help.ts +++ b/src/help.ts @@ -28,7 +28,7 @@ function getHelpSubject(args: string[]): string | undefined { if (arg === '--') { return; } - if (arg === 'help' || arg === '--help' || arg === '-h') { + if (arg === 'help' || arg === '--help') { continue; } if (arg.startsWith('-')) { @@ -135,7 +135,7 @@ export default class BalenaHelp extends Help { } const globalOps = [ - ['--help, -h', 'display command help'], + ['--help', 'display command help'], ['--debug', 'enable debug output'], [ '--unsupported', diff --git a/src/preparser.ts b/src/preparser.ts index 7fa06882..242af795 100644 --- a/src/preparser.ts +++ b/src/preparser.ts @@ -40,8 +40,8 @@ export async function preparseArgs(argv: string[]): Promise { if (['--version', '-v'].includes(cmdSlice[0])) { cmdSlice[0] = 'version'; } - // convert 'balena --help' or 'balena -h' to 'balena help' - else if (['--help', '-h'].includes(cmdSlice[0])) { + // convert 'balena --help' to 'balena help' + else if ('--help' === cmdSlice[0]) { cmdSlice[0] = 'help'; } // convert e.g. 'balena help env set' to 'balena env set --help' diff --git a/src/utils/application-create.ts b/src/utils/application-create.ts index 072b561c..b25acc98 100644 --- a/src/utils/application-create.ts +++ b/src/utils/application-create.ts @@ -4,7 +4,6 @@ import { getBalenaSdk } from './lazy'; export interface FlagsDef { organization?: string; type?: string; // application device type - help: void; } export interface ArgsDef { diff --git a/src/utils/common-flags.ts b/src/utils/common-flags.ts index 8f687cf1..ba84db13 100644 --- a/src/utils/common-flags.ts +++ b/src/utils/common-flags.ts @@ -30,8 +30,6 @@ export const device = Flags.string({ description: 'device UUID', }); -export const help = Flags.help({ char: 'h' }); - export const quiet = Flags.boolean({ char: 'q', description: 'suppress warning messages', diff --git a/tests/commands/app/create.spec.ts b/tests/commands/app/create.spec.ts deleted file mode 100644 index 290b5e37..00000000 --- a/tests/commands/app/create.spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @license - * Copyright 2019-2020 Balena Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { expect } from 'chai'; -import { BalenaAPIMock } from '../../nock/balena-api-mock'; -import { cleanOutput, runCommand } from '../../helpers'; - -const HELP_MESSAGE = ''; - -describe('balena app create', function () { - let api: BalenaAPIMock; - - beforeEach(() => { - api = new BalenaAPIMock(); - }); - - afterEach(() => { - // Check all expected api calls have been made and clean up. - api.done(); - }); - - // Temporarily skipped because of parse/checking order issue with -h - it.skip('should print help text with the -h flag', async () => { - api.expectGetWhoAmI({ optional: true }); - - const { out, err } = await runCommand('app create -h'); - - expect(cleanOutput(out)).to.deep.equal(cleanOutput([HELP_MESSAGE])); - - expect(err).to.eql([]); - }); -}); diff --git a/tests/commands/device-type/list.spec.ts b/tests/commands/device-type/list.spec.ts index 64bce186..556b52ef 100644 --- a/tests/commands/device-type/list.spec.ts +++ b/tests/commands/device-type/list.spec.ts @@ -33,8 +33,8 @@ describe('balena device-type list', function () { api.done(); }); - it('should print help text with the -h flag', async () => { - const { out, err } = await runCommand('device-type list -h'); + it('should print help text with the --help flag', async () => { + const { out, err } = await runCommand('device-type list --help'); expect(cleanOutput(out)).to.contain('$ balena device-type list'); diff --git a/tests/commands/help.spec.ts b/tests/commands/help.spec.ts index 0b395232..4d0db647 100644 --- a/tests/commands/help.spec.ts +++ b/tests/commands/help.spec.ts @@ -98,7 +98,7 @@ const LIST_ADDITIONAL = ` const GLOBAL_OPTIONS = ` GLOBAL OPTIONS - --help, -h + --help --debug `;