Skip to content

Commit

Permalink
add --get option
Browse files Browse the repository at this point in the history
  • Loading branch information
kla committed Oct 10, 2024
1 parent be50ee2 commit d87d6ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"email": "[email protected]"
},
"repository": "https://github.com/kla/stax",
"version": "0.1.2",
"version": "0.1.3",
"main": "src/index",
"type": "module",
"private": false,
Expand Down
7 changes: 6 additions & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,15 @@ program.command('cat')
program.command('config')
.argument('<name>', 'Name of application')
.option('-s, --service <name>', 'Name of service to act on')
.option('-g, --get <name>', 'Get the value of a config variable')
.description('Show config variables for the container.')
.action((name, options) => {
const container = stax.findContainer(name, options)
pp({ ...container.config, labels: container.labels })

if (options.get)
console.log(container.config.fetch(options.get) || '')
else
pp({ ...container.config, labels: container.labels })
})

program.command('copy')
Expand Down

0 comments on commit d87d6ef

Please sign in to comment.