selpg

作者: 落丶叶 | 来源:发表于2017-10-17 20:03 被阅读0次

Selpg

Use golang to develop the selpg(Command Line Interface)

Development Environment

  • Ubuntu : 16.04

  • Golang : go1.9.2 linux/amd64

How to use

  • you may at least input three args there are:
    -sNumber , is the num of start page
    -eNumber , is the num of end page
    -inputFile , is the file you want to print
  • otehr args may be:
    -l ,the num of the length of every page (default: 72)
    -f ,means every page is devided by the '\f'
    -dlpx ,means printing the output by the printer lpx

Design

Because I didn't know how to write this code at the begginning, so I just imitated the source code selpg.c, So I didn't use so many functions, which may let you see some awful. So some details of the code will be not described here.

We can see the files in the project:
-the selpg.go is the source code.
-the outputx.txt is the file to output the pages
-the testx.txt is the "inputFile" I use
-the errorx.txt is the stderr that may be printed

Here are some command(I forgot to use the $GOPATH/bin)

1.png 2.png 3.png 4.png 5.png 6.png 7.png 8.png 9.png 9_2.png

相关文章

  • selpg

    Selpg Use golang to develop the selpg(Command Line Inter...

网友评论

      本文标题:selpg

      本文链接:https://www.haomeiwen.com/subject/irqjuxtx.html