mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-18 21:27:51 +00:00
Add alias device note
for command notes
Change-type: minor
This commit is contained in:
parent
8ee5ede34d
commit
3eb3b3b584
@ -8,13 +8,13 @@ _balena() {
|
||||
local context state line curcontext="$curcontext"
|
||||
|
||||
# Valid top-level completions
|
||||
main_commands=( api-key app block build config deploy device devices env fleet internal join leave local login logout notes organization os preload push release settings ssh-key support tag util version whoami )
|
||||
main_commands=( api-key app block build config deploy device devices env fleet internal join leave local login logout organization os preload push release settings ssh-key support tag util version whoami )
|
||||
# Sub-completions
|
||||
api_key_cmds=( generate list revoke )
|
||||
app_cmds=( create )
|
||||
block_cmds=( create )
|
||||
config_cmds=( generate inject read reconfigure write )
|
||||
device_cmds=( deactivate detect identify init list local-mode logs move os-update pin public-url purge reboot register rename restart rm shutdown ssh start-service stop-service track-fleet tunnel )
|
||||
device_cmds=( deactivate detect identify init list local-mode logs move note os-update pin public-url purge reboot register rename restart rm shutdown ssh start-service stop-service track-fleet tunnel )
|
||||
devices_cmds=( supported )
|
||||
env_cmds=( list rename rm set )
|
||||
fleet_cmds=( create list pin purge rename restart rm track-latest )
|
||||
|
@ -7,13 +7,13 @@ _balena_complete()
|
||||
local cur prev
|
||||
|
||||
# Valid top-level completions
|
||||
main_commands="api-key app block build config deploy device devices env fleet internal join leave local login logout notes organization os preload push release settings ssh-key support tag util version whoami"
|
||||
main_commands="api-key app block build config deploy device devices env fleet internal join leave local login logout organization os preload push release settings ssh-key support tag util version whoami"
|
||||
# Sub-completions
|
||||
api_key_cmds="generate list revoke"
|
||||
app_cmds="create"
|
||||
block_cmds="create"
|
||||
config_cmds="generate inject read reconfigure write"
|
||||
device_cmds="deactivate detect identify init list local-mode logs move os-update pin public-url purge reboot register rename restart rm shutdown ssh start-service stop-service track-fleet tunnel"
|
||||
device_cmds="deactivate detect identify init list local-mode logs move note os-update pin public-url purge reboot register rename restart rm shutdown ssh start-service stop-service track-fleet tunnel"
|
||||
devices_cmds="supported"
|
||||
env_cmds="list rename rm set"
|
||||
fleet_cmds="create list pin purge rename restart rm track-latest"
|
||||
|
@ -204,6 +204,7 @@ are encouraged to regularly update the balena CLI to the latest version.
|
||||
- [device local-mode](#device-local-mode)
|
||||
- [device logs](#device-logs)
|
||||
- [device move](#device-move)
|
||||
- [device note](#device-note)
|
||||
- [device os-update](#device-os-update)
|
||||
- [device pin](#device-pin)
|
||||
- [device public-url](#device-public-url)
|
||||
@ -245,10 +246,6 @@ are encouraged to regularly update the balena CLI to the latest version.
|
||||
- [local configure](#local-configure)
|
||||
- [local flash](#local-flash)
|
||||
|
||||
- Notes
|
||||
|
||||
- [notes](#notes)
|
||||
|
||||
- Organizations
|
||||
|
||||
- [organization list](#organization-list)
|
||||
@ -1610,6 +1607,43 @@ comma-separated list (no blank spaces) of device UUIDs to be moved
|
||||
|
||||
fleet name or slug (preferred)
|
||||
|
||||
## device note
|
||||
|
||||
### Aliases
|
||||
|
||||
- `notes`
|
||||
|
||||
|
||||
To use one of the aliases, replace `device note` with the alias.
|
||||
|
||||
### Description
|
||||
|
||||
Set or update a device note. If the note argument is not provided,
|
||||
it will be read from stdin.
|
||||
|
||||
To view device notes, use the `balena device <uuid>` command.
|
||||
|
||||
Examples:
|
||||
|
||||
$ balena device note "My useful note" --device 7cf02a6
|
||||
$ cat note.txt | balena device note --device 7cf02a6
|
||||
|
||||
### Arguments
|
||||
|
||||
#### NOTE
|
||||
|
||||
note content
|
||||
|
||||
### Options
|
||||
|
||||
#### -d, --device DEVICE
|
||||
|
||||
device UUID
|
||||
|
||||
#### --dev DEV
|
||||
|
||||
|
||||
|
||||
## device os-update
|
||||
|
||||
### Description
|
||||
@ -2771,38 +2805,6 @@ Check `balena util available-drives` for available options.
|
||||
|
||||
answer "yes" to all questions (non interactive use)
|
||||
|
||||
# Notes
|
||||
|
||||
## notes
|
||||
|
||||
### Description
|
||||
|
||||
Set or update a device note. If the note argument is not provided,
|
||||
it will be read from stdin.
|
||||
|
||||
To view device notes, use the `balena device <uuid>` command.
|
||||
|
||||
Examples:
|
||||
|
||||
$ balena note "My useful note" --device 7cf02a6
|
||||
$ cat note.txt | balena note --device 7cf02a6
|
||||
|
||||
### Arguments
|
||||
|
||||
#### NOTE
|
||||
|
||||
note content
|
||||
|
||||
### Options
|
||||
|
||||
#### -d, --device DEVICE
|
||||
|
||||
device UUID
|
||||
|
||||
#### --dev DEV
|
||||
|
||||
|
||||
|
||||
# Organizations
|
||||
|
||||
## organization list
|
||||
|
@ -20,7 +20,9 @@ import { ExpectedError } from '../../errors';
|
||||
import * as cf from '../../utils/common-flags';
|
||||
import { getBalenaSdk, stripIndent } from '../../utils/lazy';
|
||||
|
||||
export default class NoteCmd extends Command {
|
||||
export default class DeviceNoteCmd extends Command {
|
||||
public static aliases = ['notes'];
|
||||
|
||||
public static description = stripIndent`
|
||||
Set a device note.
|
||||
|
||||
@ -31,8 +33,8 @@ export default class NoteCmd extends Command {
|
||||
`;
|
||||
|
||||
public static examples = [
|
||||
'$ balena note "My useful note" --device 7cf02a6',
|
||||
'$ cat note.txt | balena note --device 7cf02a6',
|
||||
'$ balena device note "My useful note" --device 7cf02a6',
|
||||
'$ cat note.txt | balena device note --device 7cf02a6',
|
||||
];
|
||||
|
||||
public static args = {
|
||||
@ -53,7 +55,7 @@ export default class NoteCmd extends Command {
|
||||
public static authenticated = true;
|
||||
|
||||
public async run() {
|
||||
const { args: params, flags: options } = await this.parse(NoteCmd);
|
||||
const { args: params, flags: options } = await this.parse(DeviceNoteCmd);
|
||||
|
||||
if (params.note?.length === 0) {
|
||||
throw new ExpectedError('Missing note content');
|
||||
|
@ -91,6 +91,9 @@
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/device/move.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/device/note.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/device/os-update.js
|
||||
@ -199,9 +202,6 @@
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/logout/index.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/notes/index.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/organization/list.js
|
||||
|
@ -91,6 +91,9 @@
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/device/move.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/device/note.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/device/os-update.js
|
||||
@ -199,9 +202,6 @@
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/logout/index.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/notes/index.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/organization/list.js
|
||||
|
@ -91,6 +91,9 @@
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/device/move.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/device/note.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/device/os-update.js
|
||||
@ -199,9 +202,6 @@
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/logout/index.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/notes/index.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/organization/list.js
|
||||
|
@ -91,6 +91,9 @@
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/device/move.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/device/note.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/device/os-update.js
|
||||
@ -199,9 +202,6 @@
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/logout/index.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/notes/index.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/organization/list.js
|
||||
|
@ -91,6 +91,9 @@
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules\@oclif\core\package.json
|
||||
%2: build\commands\device\move.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules\@oclif\core\package.json
|
||||
%2: build\commands\device\note.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules\@oclif\core\package.json
|
||||
%2: build\commands\device\os-update.js
|
||||
@ -199,9 +202,6 @@
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules\@oclif\core\package.json
|
||||
%2: build\commands\logout\index.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules\@oclif\core\package.json
|
||||
%2: build\commands\notes\index.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules\@oclif\core\package.json
|
||||
%2: build\commands\organization\list.js
|
||||
|
Loading…
Reference in New Issue
Block a user