-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
executable file
·37 lines (32 loc) · 1.7 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env node
const package = require('./package.json');
const program = require('commander');
const path = require('path');
const lib = path.join(__dirname, './lib');
// WARNING: If you use .action it will break all sub commands
process.title = "smar";
program
.version(package.version);
program
.command('sheet [subcommand]', 'Commands for working with sheets')
.command('row [subcommand]', 'Commands for working with rows')
.command('auth [subcommand]', 'Authorization')
.command('user [subcommand]', 'User functions')
.command('search [searchterm]', 'Search your Smartsheet account')
.command('attachments [subcommand]', 'Attachment-centric commands')
.command('discussions [subcommand]', 'Discussion-oriented commands')
.command('comments [subcommand]', 'Commands related to comments')
.command('whoami', 'shows which smartsheet account is connected');
program.on('--help', function () {
console.log('');
console.log(' Examples:');
console.log('');
console.log(' $ smar sheet get --sheet-id <sheet-id> --csv --pdf --excel');
console.log(' $ smar sheet create --sheet-name "Breakfast" --column Food,TEXT_NUMBER --column Drink,TEXT_NUMBER --primary Food');
console.log(' $ smar row export <row-ids> --format <format> --filename <filename>');
console.log(' $ smar attachments upload --sheet-id <sheet-id> --file /Users/bacon/Downloads/fryingpan.jpg')
console.log(' $ smar discussions list --sheet-id <sheet-id> --include-flags comments')
console.log(' $ smar comments add --sheet-id <sheet-id> --discussion-id <discussion-id> --comment "Recipe for delicious breakfast"')
console.log('');
});
program.parse(process.argv);