A --help argument would help

Open Beginner friendly
#28 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
cli

Research direction

Start at com.jvmtop.JvmTop.main in JvmTop.java around line 122, where the reported NumberFormatException occurs. Run ./jvmtop.sh --help and try an unknown argument to compare the current behavior with the requested usage output. Done means --help displays the options and examples instead of failing, while invalid arguments still provide useful guidance.

Written by the indexing model from the issue text.

Description

auto-migrated Priority-Medium Type-Enhancement
What steps will reproduce the problem?
1. ./jvmtop.sh --help

jvmtop has several arguments that can only be learned through looking at a few 
different pages in the wiki - since there is no source code, hard to know if 
they are all documented anywhere.

What is the expected output? What do you see instead?

[me@localhost~]$ jvmtop --help

JvmTop 0.7.1 alpha, http://code.google.com/p/jvmtop
Usage: info [OPTIONS]... [PID]

Monitor JVM metrics on the command line

Options (only one can be specified):
  --help                this text
  --once  [PID]      Run jvmtop one time, then exit
  --delay N           Delay N seconds between updates
  --profile PID      Profile a specifc JVM instance

Examples:
   jvmtop             Summarize all currently running JVM's
   jvmtop 3944    Display detailed information for a single JVM (pid #3944)
   jvmtop --delay 3 --profile 3944
                           Profile process #3944, updating the display every 3 seconds

Plus appending what you currently have written up for the column definitions on 
the ExampleOutput wiki page would be a nice touch.  


or for an unknown argument:

[me@localhost~]$ jvmtop --foo
jvmtop: unrecognized option '--foo'
Try --help for more information.


Actual:
[me@localhost~]$ jvmtop --help
Exception in thread "main" java.lang.NumberFormatException: For input string: 
"--help"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:492)
    at java.lang.Integer.parseInt(Integer.java:527)
    at com.jvmtop.JvmTop.main(JvmTop.java:122)



Original issue reported on code.google.com by DaveParillo on 8 Aug 2013 at 11:49

Dominant language
Java
Stars
5
Forks
2
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from HubSpot/jvmtop

All issues in HubSpot/jvmtop

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.