Skip to content

Commit

Permalink
Documentation: integrate envvar doc back into cli.py, from README.md
Browse files Browse the repository at this point in the history
The text was erroneously added directly to README.md in recent commits, in a
part of it that is overwritten upon automatic recreation.

As part of this change, move also this doc to a new dedicated "Environment"
section, where it belongs.
  • Loading branch information
zacchiro committed Aug 8, 2024
1 parent d31914d commit ef7a001
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 13 deletions.
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,6 @@ Usage: bean-grep [OPTIONS] [PATTERN] FILENAME...
To read from standard input, pass "-" as FILENAME, but beware that it
implies on-disk buffering of stdin.
The FILENAME can alternatively be specified via the environment variable
BEANCOUNT_FILENAME. This allows not having to specify it explicitly every
time bean-grep is run. Only a single FILENAME is allowed to be specified
this way.
All options can be set via environment variables, which is most useful if
you want to override the defaults. Each environment variable
consists of the prefix BEANGREP_ followed by the option name in uppercase.
e.g., BEANGREP_VERBOSE, BEANGREP_CASE_SENSITIVE, BEANGREP_QUIET,
BEANGREP_NO_SKIP_INTERNALS, etc. Boolean options are enabled/disabled by
setting the corresponding variables to 1/0 respectively, e.g.,
BEANGREP_QUIET=1.
Options:
-a, --account REGEX Only return entries referencing accounts
with names matching given regex.
Expand Down Expand Up @@ -192,6 +179,21 @@ Options:
- otherwise -> --somewhere
Environment:
All options can be set via environment variables, which is most useful if
you want to override the defaults. Each environment variable consists of the
prefix BEANGREP_ followed by the option name in uppercase. e.g.,
BEANGREP_VERBOSE, BEANGREP_CASE_SENSITIVE, BEANGREP_QUIET,
BEANGREP_NO_SKIP_INTERNALS, etc. Boolean options are enabled/disabled by
setting the corresponding variables to 1/0 respectively, e.g.,
BEANGREP_QUIET=1.
The FILENAME can alternatively be specified via the environment variable
BEANCOUNT_FILENAME. This allows not having to specify it explicitly every
time bean-grep is run. Only a single FILENAME is allowed to be specified
this way.
Exit status:
Exit status is 0 (success) if a match is found, 1 if no match is found, 2 if
Expand Down
15 changes: 15 additions & 0 deletions src/beangrep/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,21 @@
- otherwise -> --somewhere
Environment:
All options can be set via environment variables, which is most useful if you want to
override the defaults. Each environment variable consists of the prefix BEANGREP_
followed by the option name in uppercase. e.g., BEANGREP_VERBOSE,
BEANGREP_CASE_SENSITIVE, BEANGREP_QUIET, BEANGREP_NO_SKIP_INTERNALS, etc. Boolean
options are enabled/disabled by setting the corresponding variables to 1/0 respectively,
e.g., BEANGREP_QUIET=1.
The FILENAME can alternatively be specified via the environment variable
BEANCOUNT_FILENAME. This allows not having to specify it explicitly every time bean-grep
is run. Only a single FILENAME is allowed to be specified this way.
Exit status:
Exit status is 0 (success) if a match is found, 1 if no match is found, 2 if an error
Expand Down

0 comments on commit ef7a001

Please sign in to comment.