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

  • Home
  • SEARCH
  • 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 9199055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:26:17+00:00 2026-06-17T22:26:17+00:00

More of an aesthetic question, but why does printing cli.usage() give a null at

  • 0

More of an aesthetic question, but why does printing cli.usage() give a null at the end?

def cli = new CliBuilder(usage:'helloWord') 
 cli.help('prints this message') 
 cli.project(args:1, argName:'project', 'project name') 
 cli.desc(args:2, argName:'desc', 'project description')
 cli.f('force creation')
 def options = cli.parse(args)

if (options.help){
 print cli.usage()
 return
}

output with groovy helloWorld.groovy -help

 usage: helloWorld 
     -desc <desc>          project description
     -f                           force creation
     -help                        prints this message
     -project <project>           project name
    null
  • 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-17T22:26:19+00:00Added an answer on June 17, 2026 at 10:26 pm

    cli.usage() doesn’t return a usage string; it prints the usage string. Instead of

    print cli.usage()
    

    just call it without print:

    cli.usage()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

More a back end programmer, but I'm implementing a design, and I just wanted
This is more of aesthetic question since I want to make my life easier.
more basic questions i'm struggling with... Give the basic code below... how does the
More of a general MATLAB question than looking for programming advice -- if I
More of a design/conceptual question. At work the decision was made to have our
More specifically, does NDK have a complete STL implementation. We're looking at this for
At first glance this seems like a purely subjective/aesthetic issue, but I'd be interested
This is more of an aesthetic problem, if I were to output two prices
More easily explained with an example: my $o = SpecialEffects->new( config => 'a' );
This may be an incredibly stupid question, but I have a web application that

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.