Skip to content

Commit

Permalink
Merge pull request #10 from noffle/improvements
Browse files Browse the repository at this point in the history
usage message + bugfix when using tslide in a pipe
  • Loading branch information
noffle committed May 26, 2016
2 parents 63b8580 + 45c4bcf commit 1f9b577
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion index.js
Expand Up @@ -12,6 +12,11 @@ var js = require('hipster/highlight/javascript')
var imgcat = require('ansi-escapes').image

var file = opts._[0]
if (!file) {
console.error('USAGE: tslide [markdown-file]')
process.exit(1)
}

var text = require('fs').readFileSync(file, 'utf-8')
var slides = text.split(/---+\n/)
if(slides.length <= 1) {
Expand Down Expand Up @@ -64,7 +69,10 @@ function show () {
.reset()
.position(1, mtop)
.write(indent(content, mleft))
.position(mleft, process.stdout.rows - 1)

if (process.stdout.rows) {
charm.position(mleft, process.stdout.rows - 1)
}
}
var index = 0
show(index)
Expand Down

0 comments on commit 1f9b577

Please sign in to comment.