Skip to content

Commit

Permalink
Merge pull request #109 from julmon/fix_opts_no_db_size
Browse files Browse the repository at this point in the history
Options order
  • Loading branch information
julmon authored Mar 3, 2019
2 parents 0730be4 + cac6244 commit b654edc
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 46 deletions.
20 changes: 10 additions & 10 deletions docs/man/pg_activity.1
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,21 @@ as the user running the instance (or root) to show
.Vb 1
\& Enable support for AWS RDS.
.Ve
.IP "\fB\-\-verbose\-mode=VERBOSE_MODE\fR" 2
.IX Item "--verbose-mode=VERBOSE_MODE"
.Vb 1
\& Queries display mode. Values: 1\-TRUNCATED, 2\-FULL(default), 3\-INDENTED
.Ve
.IP "\fB\-\-output=FILEPATH\fR" 2
.IX Item "--output=FILEPATH"
.Vb 1
\& Store running queries as CSV.
.Ve
.IP "\fB\-\-no\-db\-size\fR" 2
.IX Item "--no-db-size"
.Vb 1
\& Skip total size of DB.
.Ve
.IP "\fB\-\-verbose\-mode=VERBOSE_MODE\fR" 2
.IX Item "--verbose-mode=VERBOSE_MODE"
.Vb 1
\& Queries display mode. Values: 1\-TRUNCATED, 2\-FULL(default), 3\-INDENTED
.Ve
.IP "\fB\-\-help\fR" 2
.IX Item "--help"
.Vb 1
Expand Down Expand Up @@ -237,11 +242,6 @@ as the user running the instance (or root) to show
.Vb 1
\& Disable DATABASE.
.Ve
.IP "\fB\-\-no\-db\-size\fR" 2
.IX Item "--no-db-size"
.Vb 1
\& Disable DATABASE size.
.Ve
.IP "\fB\-\-no\-user\fR" 2
.IX Item "--no-user"
.Vb 1
Expand Down
16 changes: 8 additions & 8 deletions docs/man/pg_activity.pod
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,18 @@ CPU, MEM, READ or WRITE columns and other system informations.

Enable support for AWS RDS.

=item B<--verbose-mode=VERBOSE_MODE>

Queries display mode. Values: 1-TRUNCATED, 2-FULL(default), 3-INDENTED

=item B<--output=FILEPATH>

Store running queries as CSV.

=item B<--no-db-size>

Skip total size of DB.

=item B<--verbose-mode=VERBOSE_MODE>

Queries display mode. Values: 1-TRUNCATED, 2-FULL(default), 3-INDENTED

=item B<--help>

Show this help message and exit.
Expand Down Expand Up @@ -98,10 +102,6 @@ CPU, MEM, READ or WRITE columns and other system informations.

Disable DATABASE.

=item B<--no-db-size>

Disable DATABASE size.

=item B<--no-user>

Disable USER.
Expand Down
58 changes: 30 additions & 28 deletions pg_activity
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,34 @@ server activity monitoring.")
action = 'store_true',
help = "Enable support for AWS RDS",
default = False)
# --output
parser.add_option(
'--output',
dest = 'output',
help = "Store running queries as CSV.",
metavar = "FILEPATH",
default = None)
# --help
parser.add_option(
'--help',
dest = 'help',
action = 'store_true',
help = "Show this help message and exit.",
default = 'false')
# --debug
parser.add_option(
'--debug',
dest = 'debug',
action = 'store_true',
help = "Enable debug mode for traceback tracking.",
default = 'false')
# --no-db-size
parser.add_option(
'--no-db-size',
dest = 'nodbsize',
action = 'store_true',
help = "Skip total size of DB.",
default = False)
# --verbose-mode
parser.add_option(
'--verbose-mode',
Expand All @@ -137,6 +165,7 @@ server activity monitoring.")
metavar = 'VERBOSE_MODE',
choices = ['1', '2', '3'],
default = '2')

group = OptionGroup(
parser,
"Display Options, you can exclude some columns by using them ")
Expand All @@ -147,13 +176,6 @@ server activity monitoring.")
action = 'store_true',
help = "Disable DATABASE.",
default = 'false')
# --no-db-size
group.add_option(
'--no-db-size',
dest = 'nodbsize',
action = 'store_true',
help = "Disable DATABASE size.",
default = False)
# --no-user
group.add_option(
'--no-user',
Expand Down Expand Up @@ -217,28 +239,8 @@ server activity monitoring.")
action = 'store_true',
help = "Disable App.",
default = 'false')

parser.add_option_group(group)
# --output
parser.add_option(
'--output',
dest = 'output',
help = "Store running queries as CSV.",
metavar = "FILEPATH",
default = None)
# --help
parser.add_option(
'--help',
dest = 'help',
action = 'store_true',
help = "Show this help message and exit.",
default = 'false')
# --debug
parser.add_option(
'--debug',
dest = 'debug',
action = 'store_true',
help = "Enable debug mode for traceback tracking.",
default = 'false')
(options, _) = parser.parse_args()
except OptionParsingError as err:
print('pg_activity: error: %s' % err.msg)
Expand Down

0 comments on commit b654edc

Please sign in to comment.