Skip to content

Commit

Permalink
Add help messages (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasericsson authored Sep 21, 2024
1 parent 99edf75 commit 5eeac75
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
8 changes: 6 additions & 2 deletions src/cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ def main(args):

if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--interval", type=int, default=1)
parser.add_argument("--percpu", action="store_true", default=False)
parser.add_argument(
"-i", "--interval", type=int, default=1, help="interval in seconds"
)
parser.add_argument(
"--percpu", action="store_true", default=False, help="display per cpu usage"
)
args = parser.parse_args()
main(args)
20 changes: 17 additions & 3 deletions src/disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,22 @@ def main(args):
if __name__ == "__main__":
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group()
group.add_argument("-t", "--total", action="store_true", default=False)
group.add_argument("-f", "--free", action="store_true", default=False)
parser.add_argument("-p", "--path", type=str, default=None)
group.add_argument(
"-t",
"--total",
action="store_true",
default=False,
help="display disk usage as used/total in GB",
)
group.add_argument(
"-f",
"--free",
action="store_true",
default=False,
help="display free disk in GB",
)
parser.add_argument(
"-p", "--path", type=str, default=None, help="path to check disk usage"
)
args = parser.parse_args()
main(args)
8 changes: 7 additions & 1 deletion src/mem.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ def main(args):

if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-t", "--total", action="store_true", default=False)
parser.add_argument(
"-t",
"--total",
action="store_true",
default=False,
help="display memory usage as used/total in GB",
)
args = parser.parse_args()
main(args)

0 comments on commit 5eeac75

Please sign in to comment.