mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-02-11 13:16:12 +00:00
balena apps: add --verbose option to list application slugs (full app name)
Change-type: minor
This commit is contained in:
parent
5b33826309
commit
be21c8d43e
@ -307,6 +307,10 @@ Examples:
|
|||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
|
#### -v, --verbose
|
||||||
|
|
||||||
|
add extra columns in the tabular output (SLUG)
|
||||||
|
|
||||||
## app <name>
|
## app <name>
|
||||||
|
|
||||||
Display detailed information about a single balena application.
|
Display detailed information about a single balena application.
|
||||||
|
@ -29,6 +29,7 @@ interface ExtendedApplication extends Application {
|
|||||||
|
|
||||||
interface FlagsDef {
|
interface FlagsDef {
|
||||||
help: void;
|
help: void;
|
||||||
|
verbose?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class AppsCmd extends Command {
|
export default class AppsCmd extends Command {
|
||||||
@ -46,13 +47,17 @@ export default class AppsCmd extends Command {
|
|||||||
|
|
||||||
public static flags: flags.Input<FlagsDef> = {
|
public static flags: flags.Input<FlagsDef> = {
|
||||||
help: cf.help,
|
help: cf.help,
|
||||||
|
verbose: flags.boolean({
|
||||||
|
char: 'v',
|
||||||
|
description: 'add extra columns in the tabular output (SLUG)',
|
||||||
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
public static authenticated = true;
|
public static authenticated = true;
|
||||||
public static primary = true;
|
public static primary = true;
|
||||||
|
|
||||||
public async run() {
|
public async run() {
|
||||||
this.parse<FlagsDef, {}>(AppsCmd);
|
const { flags: options } = this.parse<FlagsDef, {}>(AppsCmd);
|
||||||
|
|
||||||
const _ = await import('lodash');
|
const _ = await import('lodash');
|
||||||
const balena = getBalenaSdk();
|
const balena = getBalenaSdk();
|
||||||
@ -60,7 +65,7 @@ export default class AppsCmd extends Command {
|
|||||||
// Get applications
|
// Get applications
|
||||||
const applications: ExtendedApplication[] = await balena.models.application.getAll(
|
const applications: ExtendedApplication[] = await balena.models.application.getAll(
|
||||||
{
|
{
|
||||||
$select: ['id', 'app_name', 'device_type'],
|
$select: ['id', 'app_name', 'slug', 'device_type'],
|
||||||
$expand: { owns__device: { $select: 'is_online' } },
|
$expand: { owns__device: { $select: 'is_online' } },
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -78,6 +83,7 @@ export default class AppsCmd extends Command {
|
|||||||
getVisuals().table.horizontal(applications, [
|
getVisuals().table.horizontal(applications, [
|
||||||
'id',
|
'id',
|
||||||
'app_name',
|
'app_name',
|
||||||
|
options.verbose ? 'slug' : '',
|
||||||
'device_type',
|
'device_type',
|
||||||
'online_devices',
|
'online_devices',
|
||||||
'device_count',
|
'device_count',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user