Skip to content

ryanvz/thosts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#thosts Easy toggling/querying sections of your hosts file.

##Installation

For now, clone the repo somewhere, then create a symbolic link to thosts somewhere in your path. For example:

git clone [email protected]:ryanvz/thosts.git
ln -s thosts/thosts /usr/local/bin/thosts

##Usage

###Status

Run without arguments (or with option -l) To list the currently enabled sections. This is an easy way to quickly check what sections are enabled

> thosts

remote_env = ON
widgets/dev = OFF
widgets/test = ON
widgets/staging = OFF

To print the effective hosts file, use the -p option. This could be done by reading the hosts file directly, but without the clutter of the commented out sections

> thosts -p

127.0.0.1	localhost
255.255.255.255	broadcasthost
192.168.1.1 mysite.com

###Toggling Sections

When modifying hosts, you will likely need root access, so use sudo to run thosts

Simply pass the name of the section you wish to toggle

> sudo thosts remote_env

Enabled sections:
remote_env
widgets/test

> sudo thosts remote_env
widgets/test

###Groups Use groups to enforce only one section being enabled among a group of a sections (think radio-button behavior). To define a group, simply name the section with a forward slash separating the group name: group/section

Built-in help is also available

> thosts --help

About

Simple hosts file management

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages