mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-11-01 20:00:10 +00:00
playing with cli handling structure...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
d7eebd9719
commit
fda89e53c0
@ -69,22 +69,9 @@ module.CLI = core.ImageGridFeatures.Feature({
|
||||
.version('0.0.1')
|
||||
//.usage('[command] [options] ..')
|
||||
|
||||
.option('--list-features', 'list loaded features')
|
||||
|
||||
//.command('index [path]', 'build an index of path')
|
||||
|
||||
.arguments('<action> [args]')
|
||||
.action(function(action, args){
|
||||
// XXX
|
||||
console.log('>>>>', action, args)
|
||||
})
|
||||
|
||||
.parse(argv)
|
||||
|
||||
|
||||
// list features...
|
||||
// XXX make this a core action... (???)
|
||||
if(cli.listFeatures){
|
||||
.option('--list-features', 'list loaded features', function(){
|
||||
// excluded...
|
||||
this.features.excluded.length > 0
|
||||
&& console.warn('Features excluded (%d):\n ',
|
||||
@ -100,7 +87,26 @@ module.CLI = core.ImageGridFeatures.Feature({
|
||||
console.log('Features loaded (%d):\n ',
|
||||
this.features.features.length,
|
||||
this.features.features.join('\n '))
|
||||
}
|
||||
})
|
||||
|
||||
// list actions...
|
||||
// XXX this is a bit pointless as single actions are
|
||||
// meaningless when no state is stored...
|
||||
.option('--list-actions', 'list loaded actions', function(){
|
||||
console.log('Actions loaded (%d):\n ',
|
||||
this.length,
|
||||
Object.keys(this.getDoc()).join('\n '))
|
||||
})
|
||||
|
||||
//.command('index [path]', 'build an index of path')
|
||||
|
||||
.arguments('<action> [args]')
|
||||
.action(function(action, args){
|
||||
// XXX
|
||||
console.log('>>>>', action, args)
|
||||
})
|
||||
|
||||
.parse(argv)
|
||||
}]
|
||||
],
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user