GithubHelp home page GithubHelp logo

jackdp / inimod Goto Github PK

View Code? Open in Web Editor NEW
13.0 2.0 2.0 185 KB

Console application for managing INI files. Windows & Linux.

Home Page: https://www.pazera-software.com/products/inimod/

Batchfile 9.65% Pascal 90.35%
ini ini-file ini-reader ini-writer ini-files ini-modder ini-tool ini-config

inimod's Introduction

IniMod

Overview

Console application for managing INI files.

The program allows you to perform basic operations on INI files, such as saving and reading key values, creating and deleting sections, renaming and deleting keys, adding and removing a file comment and section comment, etc.

Screenshot

Examples

Download

Source: https://github.com/jackdp/IniMod

Compiled binaries (32 & 64-bit for Windows and Linux): https://www.pazera-software.com/products/inimod/

Usage

IniMod COMMAND FILES OPTIONS

Options are case-insensitive. Options and values in square brackets are optional.
All parameters that do not start with the - or / sign are treated as file names/masks.
Options and input files can be placed in any order, but -- (double dash followed by space) indicates the end of parsing options and all subsequent parameters are treated as file names/masks.

Commands

Command Description Usage
w, Write Writes a key value. IniMod32 w FILES -s Section -k Key -v Value
r, Read Reads and displays the value of a key. IniMod32 r FILES -s Section -k Key
rnk, RenameKey Renames the given key. IniMod32 rnk FILES -s Section -k OldKeyName -kn NewKeyName
rmk, RemoveKey Removes the key. IniMod32 rmk FILES -s Section -k Key
rms, RemoveSection Removes the given section. IniMod32 rms FILES -s Section
ras, RemoveAllSections Removes all sections. IniMod32 ras FILES
rs, ReadSection Displays section keys and values. IniMod32 rs FILES -s Section
rk, ReadKeys Displays section keys. IniMod32 rk FILES -s Section
ls, ListSections Displays the names of all sections. IniMod32 ls FILES
wsc, WriteSectionComment Adds one line to the section comment. IniMod32 wsc FILES -s Section -c Comment [-x NUM]
rsc, RemoveSectionComment Clears section comment. IniMod32 rsc FILES -s Section
wfc, WriteFileComment Adds one line to the file comment. IniMod32 wfc FILES -c Comment [-x NUM]
rfc, RemoveFileComment Clears file comment. IniMod32 rfc FILES

Options

Option Description
-s, --section=NAME Section name.
-k, --key=NAME Key name.
-kn, --new-key-name=NAME Key name.
-v, --value=STR Key value.
-c, --comment=STR Section or file comment.
-x NUM Padding spaces (for comments). NUM - a positive integer.
-rd, --recurse-depth=NUM Recursion depth when searching for files. NUM - a positive integer.
--silent Do not display some messages.
-h, --help Show this help.
--version Show application version.
--license Display program license.
--home Opens program homepage in the default browser.
--github Opens the GitHub page with the program's source files.

FILES

Any combination of file names/masks.
Eg.: file.ini *config*.ini "long file name.ini"

Exit codes

Exit code Description
0 OK (no error)
1 Other error
2 Syntax error

Hints

INI files are saved using UTF-8 encoding.

To create a new section, run the program with the Write command and specify the name of the desired section. If this section does not exist in the INI file, it will be created automatically.

All lines in INI files that start with the character ; are comments.

The file comment is the comment before the first section.
Each time the program is run with the WriteFileComment command, one line is added to the end of the current file comment.

A section comment is between the section name and the first section key.
Each run of the program with the WriteSectionComment command adds one line to the end of the current comment for the specified section.

License

Public domain. You can do with my code and compiled binaries whatever you want without any limitations.

Note

I wrote this program many years ago for my own use. I use it very often, maybe it will also be useful to someone.

Compilation

To compile, you need the Lazarus IDE with the Free Pascal Compiler (FPC) 3.2.0 (or newer) and several units from the JPLib package.

How to build:

  1. Open and build JPLib package in the Lazarus IDE.
  2. Open the project file: src\IniMod.lpi.
  3. Build project (menu Run->Build).

Releases

2021.02.02 - Version 1.0

inimod's People

Contributors

jackdp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

inimod's Issues

escape/write a quote in a value?

Awesome util, thank you.

Is there a way to escape/write a double quote into a value for example:

--key=key --value="Value One" "Value Two"
will result in
key=Value One

--key=key --value=""Value One" "Value Two""
key="Value One

--key=key --value=""Value One" "Value Two""
key="Value One\

--key=key "--value="Value One" "Value Two""
key=

I don't know if I've missed it (how to?) or if it's missing (possible add)?

Thanks,
Alex

Cant handel key's with spaces

for example the follwoing cat from an ini file

` ; Level 1 = basic
; Level 2 = verbose
; Level 3 = debug
;
; Note that the loglevel can also be set in a specific stanza and that value
; will override the value defined here only for that specific stanza

    loglevel=2

    ; logfile time stamp.  defaults to NNN DD HH:II:SS if not set here
    ;logstamp = YYYYHHMMHHIISS

    ; Log roller type:
    ;   0 = Do not roll log files
    ;   1 = Roll by number of files/filesize
    ;   2 = Roll by number of days

    logtype = 0

root@deb11:/opt/mystic# ./inimod r mutil.ini -S General -k loglevel
Processing file 1/1 : /opt/mystic/mutil.ini
2

root@deb11:/opt/mystic# ./inimod r mutil.ini -S General -k logtype
Processing file 1/1 : /opt/mystic/mutil.ini
Key "logtype" does not exists!
`
could you add support for spaces in the files

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.