From 477724366b99cd0f9945950da0c7ff83148830c3 Mon Sep 17 00:00:00 2001 From: Jacob Quinn Date: Tue, 13 Feb 2018 13:55:45 -0700 Subject: [PATCH] Update README.md --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/README.md b/README.md index b4f20d1..5e242ad 100644 --- a/README.md +++ b/README.md @@ -6,3 +6,44 @@ [![Build Status](https://travis-ci.org/JuliaIO/IniFile.jl.svg?branch=master)](https://travis-ci.org/JuliaIO/IniFile.jl) Reading and writing Windows-style INI files from Julia + +## Usage + +```julia +Pkg.add("IniFile") # first-time only +using Inifile # load code into current session +``` + +#### Create IniFile +```julia +ini = IniFile() +``` + +#### Get defaults & sections of an IniFile +```julia +sections(ini) +defaults(ini) +``` + +#### Get specific key from section, return `default` if not found +```julia +get(ini, "section", "key", default) +``` + +#### Set key for section +```julia +set(ini, "section", "key", value) +``` + +#### Parse a `*.ini` file +```julia +ini = read(IniFile(), "file.ini") +``` + +#### Write out a `*.ini` file +```julia +open("file.ini", "w+") do io + write(io, ini) +end +``` +