Skip to content
/ csl Public

A basic package to identify the type of console attached to the program

License

Notifications You must be signed in to change notification settings

hippwn/csl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hippwn/csl

A basic package to identify the type of console attached to the program.

Installation

go get github.com/hippwn/csl

Usage

CLS currently provides only one API method. GetConsole() returns an integer you'll have to compare with the package constants.

package main

import (
	"fmt"

	"github.com/hippwn/csl"
)

func main() {
	switch csl.GetConsole() {
	case csl.CSL_NULL:
		// no console available :(

	case csl.CSL_TERM:
		fmt.Println("Hi terminal!")

	case csl.CSL_REDIRECT:
		fmt.Println("That's redirected.")

	case csl.CSL_ERR:
		fmt.Println("Oops, idk what this is :o")
	}

}

About

A basic package to identify the type of console attached to the program

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages