@cliz/transfer
Version:
a simple commandline to transfer file (file transfer)
33 lines (32 loc) • 1.01 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const commander_1 = require("commander");
const cli_1 = require("@cliz/cli");
const command = require("../command");
async function main() {
await cli_1.api.pkg.load(cli_1.api.path.pkg(__dirname));
const debug = cli_1.api.debug('index');
const program = new commander_1.Command();
program
.name(cli_1.api.pkg.bin)
.version(cli_1.api.pkg.version)
.description(cli_1.api.pkg.description);
program
.command('send <filepath>')
.description('Send file')
.action((filepath) => {
command.send(cli_1.api, filepath);
});
program
.command('receive <uri> <filename>')
.description('Receive file, uri = ip:port')
.action((uri, filename) => {
command.receive(cli_1.api, uri, filename);
});
program.parse(process.argv);
if (!process.argv.slice(1).length) {
program.outputHelp();
}
}
main();