Skip to content

sanyaade-embedded-systems/xflag

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

xflag extends flag and provides methods to open files for reading and writing.

import "github.com/stevedonovan/xflag"

var flag = xflag.NewFlag()
var ofp = flag.CreateFile("o","stdout","output file")
var iflp = flag.OpenFileList("#1","stdin","input files")

Here ofp is type **os.File, and iflp is *[]string. This will verify that all parameters on the command-line can be opened for reading.

Otherwise, all the methods of package flag are available.

You can read in simple configuration files with flag.ParseConfig and have the lines mapped to flag variables.

Steve Donovan, Copyright 2011 Licence: MIT/X11

About

Extended version of Go's flag package, with support for opening files and positional parameters

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published