Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8859815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:08:48+00:00 2026-06-14T15:08:48+00:00

I use Apache Commons CLI for parsing command line arguments. I am looking for

  • 0

I use Apache Commons CLI for parsing command line arguments.

I am looking for a way to display multiple argument value names in the help.
Here is an example for one argument of the option “startimport”:

Option startimport = OptionBuilder
                .withArgName("environment")
                .hasArg()
                .withDescription(
                        "Description")
                .create("startimport");

When I use -help it prints out:

-startimport <environment>                    Description

Thatfs fine. But what if I want to use two arguments?

Option startimport = OptionBuilder
                .withArgName("firstArg secondArg")
                .hasArgs(2)
                .withDescription("Description")
                .create("startimport ");

Parsing the two arguments is not the problem but I want the following output in the “-help”:

startimport <firstArg> <secondArg>                    Description

But currently I would just get:

startimport <firstArg secondArg>                    Description

Is there a proper solution for that problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T15:08:48+00:00Added an answer on June 14, 2026 at 3:08 pm

    I used a naughty way to solve this problem.

        OptionBuilder.hasArgs(3);
        OptionBuilder.withArgName("hostname> <community> <oid");
        OptionBuilder.withDescription("spans switch topology. Mutually exclusive with -s");
        Option my_a = OptionBuilder.create("a");
    

    It appears correctly in the help now. Though I am not sure if this has consequences though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Apache commons CLI for command line parsing in a Scala utility
I am trying to use GLSMultipleLinearRegression (from apache commons-math package) for multiple linear regression.
I am trying to figure out how to use Apache Commons IO DirectoryWalker .
I am trying to use org.apache.commons.collections.CollectionUtils in android with following code import java.util.ArrayList; import
I am trying to download an image from URL. I use the Apache Commons
I'm trying to use VFS S3 a plugin for the Apache Commons VFS for
I use apache commons http client to send data via post every second, is
I'm trying to use Apache Commons Net for FTP file transfers. Problem is files
I only need to use this class org.apache.commons.io.FileUtils, and yet I'm downloading all commons
I use GWT and a lot of classes from apache commons in a project.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.