cli for getting list of repos

Signed-off-by: dzdidi <deniszalessky@gmail.com>
This commit is contained in:
dzdidi
2024-02-06 13:38:35 +00:00
parent 03453f3ab4
commit e65fc0134f
2 changed files with 58 additions and 2 deletions

View File

@@ -224,10 +224,13 @@ program
program
.command('list')
.description('list all gitpear repos')
.addArgument(new commander.Argument('[u]', 'url to remote pear').default(''))
.option('-s, --shared', 'list only shared repos')
.action((p, options) => {
.action((u, options) => {
if (u) return require('./list-remote')(u)
const k = home.readPk()
const s = options.opts().shared
const s = options.shared
home.list(s).forEach(n => console.log(n, ...(s ? ['\t', `pear://${k}/${n}`] : [])))
})