Skip to content
/ selpg Public

use golang to develop the CLI(Command Line Interface)

Notifications You must be signed in to change notification settings

Leeegal/selpg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Selpg

Use golang to develop the selpg(Command Line Interface)

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 And Test

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

About

use golang to develop the CLI(Command Line Interface)

file:///C:/Users/liguo/Desktop/cli-basic.html

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages