Skip to content

Commit

Permalink
Simplified cmdline args.
Browse files Browse the repository at this point in the history
  • Loading branch information
xybu committed Oct 15, 2016
1 parent 1f5762c commit 6b4a85d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ After installing, try with command `resmon --help` for more info:

```bash
xb@precision:[~/projects/python-resmon]: resmon --help
usage: resmon [-h] --delay DELAY [--flush [FLUSH]] [--outfile [OUTFILE]]
usage: resmon [-h] [--delay DELAY] [--flush] [--outfile [OUTFILE]]
[--nic [NIC]] [--nic-outfile [NIC_OUTFILE]] [--enable-ps]
[--ps-keywords [PS_KEYWORDS [PS_KEYWORDS ...]]]
[--ps-pids [PS_PIDS [PS_PIDS ...]]] [--ps-outfile [PS_OUTFILE]]
Expand All @@ -63,8 +63,7 @@ optional arguments:
-h, --help show this help message and exit
--delay DELAY, -d DELAY
Interval, in sec, to poll information.
--flush [FLUSH], -f [FLUSH]
If set True, flush the output files after each line is
--flush, -f If present, flush the output files after each line is
written.
--outfile [OUTFILE], -o [OUTFILE]
Name of system monitor output file. If unset, print to
Expand Down
7 changes: 3 additions & 4 deletions resmon/resmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,9 @@ def chprio(prio):
def main():
parser = argparse.ArgumentParser(
description='Monitor system-wide resource availability. Optionally monitor processes that match the specified criteria and their children.')
parser.add_argument('--delay', '-d', type=int, default=4,
required=True, help='Interval, in sec, to poll information.')
parser.add_argument('--flush', '-f', type=bool, nargs='?', default=False,
help='If set True, flush the output files after each line is written.')
parser.add_argument('--delay', '-d', type=int, default=1, help='Interval, in sec, to poll information.')
parser.add_argument('--flush', '-f', default=False, action='store_true',
help='If present, flush the output files after each line is written.')
parser.add_argument('--outfile', '-o', type=str, nargs='?', default=None,
required=False, help='Name of system monitor output file. If unset, print to stdout.')
parser.add_argument('--nic', '-n', type=str, nargs='?', default=None, required=False,
Expand Down

0 comments on commit 6b4a85d

Please sign in to comment.