GithubHelp home page GithubHelp logo

nilium / binit Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 1.0 13 KB

Small env-like tool for exec'ing programs after loading env vars from INI files (Migrated to https://git.sr.ht/~nilium/binit)

Go 94.07% Makefile 5.93%

binit's Introduction

binit(1) Manual Page

Name

binit - execs a program with environment variables loaded from INI files

Synopsis

binit [OPTION]…​ [CMD]…​

Description

binit is an env-like tool to exec programs with environment variables loaded from INI files (similar to chpst -e dir as well in that regard).

INI files are loaded by passing a path to a file with the -f=FILE option.

Options

-c={c|u|d}

Case transformations to apply to keys.

  • c - preserve variable names' case.

  • u - uppercase all variable names.

  • d - lowercase all variable names.

-e=NAME=VALUE

Set the environment variable NAME to VALUE. May be set multiple times to set multiple variables.

-f=FILE

INI files to load into the environment. Pass '-' (hyphen) for FILE to read from standard input. May be set multiple times to load multiple files.

-L

Config file values are appended to environment config instead of prepended. May be combined with -n and -N to double-negate precedence.

-i

Whether to omit current environment variables from the exec.

-m=NAME

Import a specific variable from the environment. May include * for wildcard matches. May be set multiple times to import multiple variables.

Implies -i.

-n

Preserve only the last-set value for an environment value. If two values are encountered, instead of merging them using the -s separator, it will discard all but the last value seen.

-N

Preserve only the first-set value for an environment value when -n is set.

Implies -n.

-S=SEPARATOR

The string separator inserted between group names and keys in INI files. Defaults to "." (dot or period).

-s=SEPARATOR

The string separator inserted between multi-value keys. May include Go escape characters if quoted according to Go. Defaults to " " (space).

Examples

binit -e thing.var=value -f config.ini -i

Without a CMD, binit will print a list of all environment variables it would pass to a CMD.

binit -f config.ini -N some-service

Run some-service after loading env vars from config.ini. With -N, the env vars in the environment take precedence over those of the config file.

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.