You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Peter Donald <do...@mad.scientist.com> on 2000/07/25 02:27:13 UTC

[RFE] Default Help target on error ?

Hi,

I have another request for enhancement :P. Would it be possible to specifiy
the help target in project. If the user tries to build a target that
doesn't exist they can then be told to run "ant <insertname of help
target>" to get help or else it could be automatically run.

I had a few people complain cause they didn't know how to get help off the
bat and had to read through buildfile to find help target (which WAS called
help but ....).


Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*

Re: [RFE] Default Help target on error ?

Posted by do...@mad.scientist.com.
On Tue, 25 Jul 2000, James Duncan Davidson wrote:
> I wouldn't call it a "feature" -- more like "hmm, lets make this as user
> friendly as possible" and not thinking it through :)

:P

> What about:
> 
>     ant -help (how to use ant)
>     ant -projecthelp (how to use this project, grabs description from xml
> 
> Sample xml:
> 
>     <project name="foo">

..snip... looks good ... Very good even :P

> Of course then you could have a whole discussion about what line endings
> mean, is the internal text in HTML format, etc... I really don't have an
> opinion on that -- but I do think that this general idea is good.

yup as long as you can get the help from command line then
everything is right as rain :P

Cheers,

Pete

*--------------------------------------------------*
| Latrobe University,     |                        |
| Bundoora, Australia     | Does the name 'Pavlov' |
| Office: PW220           |    ring a bell ?       |
| Ex: 2503                |                        |
*--------------------------------------------------*


Re: [RFE] Default Help target on error ?

Posted by James Duncan Davidson <du...@x180.com>.
on 7/25/00 4:52 AM, Peter Donald at donaldp@mad.scientist.com wrote:

> will give help about ant rather than execute the help task. Damn
> infuriating when you have to explain to a bunch of people who don't want to
> read a build file that the most obvious thing they could do (namely "ant
> help") is excluded due to a design "feature" in ant.

I wouldn't call it a "feature" -- more like "hmm, lets make this as user
friendly as possible" and not thinking it through :)

>> If a <help> or <about> section is being proposed to be added to the
>> <project> which would give info about this particular project, I'm not
>> opposed to that.
> 
> That would probably be a better idea but I am just using a target named
> xhelp at the moment that is full of echos much like all the apache projects.

What about:

    ant -help (how to use ant)
    ant -projecthelp (how to use this project, grabs description from xml

Sample xml:

    <project name="foo">
       <help>
          This project is the &quote;foo&quote; project. You have the
          several following targets to hit:
          
          *) main
          *) dist
          *) clean
        </help>
    
        ... tasks and such ...
    </project>

Of course then you could have a whole discussion about what line endings
mean, is the internal text in HTML format, etc... I really don't have an
opinion on that -- but I do think that this general idea is good.

.duncan


RE: [RFE] Default Help target on error ?

Posted by Conor MacNeill <co...@m64.com>.
Peter,

I am planning to remove all options which do not start with "-" including
help to avoid conflicts with what may be legitimate targets.

Conor



Re: [RFE] Default Help target on error ?

Posted by Peter Donald <do...@mad.scientist.com>.
At 03:07  25/7/00 -0700, you wrote:
>on 7/24/00 5:27 PM, Peter Donald at donaldp@mad.scientist.com wrote:
>
>> Hi,
>> 
>> I have another request for enhancement :P. Would it be possible to specifiy
>> the help target in project. If the user tries to build a target that
>> doesn't exist they can then be told to run "ant <insertname of help
>> target>" to get help or else it could be automatically run.
>
>ant -help works for ant related help. 

not what is wanted by these guys. They don't want to read the build file
(that come close to 
900 lines) to figure out what targets are available and which ones are
useful. Usually a project has a target named help - or something similar.
However "help" is a reserved target and if you ask for help target ant
ignores you and fires it's own internal help. I want to provide help to
developers via some standard way and the most logical is ant help but this
will give help about ant rather than execute the help task. Damn
infuriating when you have to explain to a bunch of people who don't want to
read a build file that the most obvious thing they could do (namely "ant
help") is excluded due to a design "feature" in ant.

Hence I would like to add an attribute to project element much like the
default attribute to specify help.

>If a <help> or <about> section is being proposed to be added to the
><project> which would give info about this particular project, I'm not
>opposed to that.

That would probably be a better idea but I am just using a target named
xhelp at the moment that is full of echos much like all the apache projects. 


Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*

Re: [RFE] Default Help target on error ?

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "CM" == Conor MacNeill <co...@cortexebusiness.com.au> writes:

 CM> so you can't have a help target, as far as I can see.

+1

didn't realize you couldn't.

RE: [RFE] Default Help target on error ?

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
The current code is

if (arg.equals("-help") || arg.equals("help")) {
    printUsage();
    return;

so you can't have a help target, as far as I can see. Personally I would
like to get rid of that.

Conor



--
Conor MacNeill
conor@cortexebusiness.com.au
Cortex eBusiness
http://www.cortexebusiness.com.au

> -----Original Message-----
> From: Stefan Bodewig [mailto:bodewig@bost.de]
> Sent: Tuesday, 25 July 2000 17:07
> To: ant-dev@jakarta.apache.org
> Subject: Re: [RFE] Default Help target on error ?
>
>
> >>>>> "CM" == Conor MacNeill <co...@cortexebusiness.com.au> writes:
>
>  CM> Am I missing something?
>
> Peter asked for a something that invoked help for the build process,
> not help for Ant. I'm sure he knows about "-help".
>
> And for a project specific help output "ant help" - together with a
> help target - seems more than appropriate. I was not proposing to add
> a magic meaning to a target named help, just pointed out how to do it
> right now.
>
> Stefan
>


Re: [RFE] Default Help target on error ?

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "CM" == Conor MacNeill <co...@cortexebusiness.com.au> writes:

 CM> Am I missing something?

Peter asked for a something that invoked help for the build process,
not help for Ant. I'm sure he knows about "-help". 

And for a project specific help output "ant help" - together with a
help target - seems more than appropriate. I was not proposing to add
a magic meaning to a target named help, just pointed out how to do it
right now.

Stefan

RE: [RFE] Default Help target on error ?

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
> -----Original Message-----
> From: Stefan Bodewig [mailto:bodewig@bost.de]
> Sent: Tuesday, 25 July 2000 16:48
> To: ant-dev@jakarta.apache.org
> Subject: Re: [RFE] Default Help target on error ?
> 
> 
> >>>>> "PD" == Peter Donald <do...@mad.scientist.com> writes:
> 
>  PD> Other people however want a standard way to get help. In GNU apps
>  PD> u just give --help and help will be displayed. There is no
>  PD> equivelent standard for Ant and Ant newbies miss it :P
> 
> So just tell them the standard is to have a target named "help" and
> the standard Ant way of invoking the help is "ant help"?
> 

I'm not really following this thread. I'm not sure why we have 

ant help

This means no user can have a help target. 

ant -help 

works and seems more regular.

Am I missing something?

Conor


Re: [RFE] Default Help target on error ?

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "PD" == Peter Donald <do...@mad.scientist.com> writes:

 PD> Other people however want a standard way to get help. In GNU apps
 PD> u just give --help and help will be displayed. There is no
 PD> equivelent standard for Ant and Ant newbies miss it :P

So just tell them the standard is to have a target named "help" and
the standard Ant way of invoking the help is "ant help"?

Not totally serious here.

Stefan

Re: [RFE] Default Help target on error ?

Posted by Peter Donald <do...@mad.scientist.com>.
At 08:33  25/7/00 +0200, you wrote:
>>>>>> "PD" == Peter Donald <do...@mad.scientist.com> writes:
>
> PD> I had a few people complain cause they didn't know how to get
> PD> help off the bat and had to read through buildfile to find help
> PD> target (which WAS called help but ....).
>
>You could make "help" the default target - people more familiar would
>invoke "ant compile" or whatever.
>
>Just a thought.

yep - it is not so much for me. I have all standard targets. Other people
however want a standard way to get help. In GNU apps u just give --help and
help will be displayed. There is no equivelent standard for Ant and Ant
newbies miss it :P

Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*

Re: [RFE] Default Help target on error ?

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "PD" == Peter Donald <do...@mad.scientist.com> writes:

 PD> I had a few people complain cause they didn't know how to get
 PD> help off the bat and had to read through buildfile to find help
 PD> target (which WAS called help but ....).

You could make "help" the default target - people more familiar would
invoke "ant compile" or whatever.

Just a thought.

Stefan

Re: [RFE] Default Help target on error ?

Posted by James Duncan Davidson <du...@x180.com>.
on 7/24/00 5:27 PM, Peter Donald at donaldp@mad.scientist.com wrote:

> Hi,
> 
> I have another request for enhancement :P. Would it be possible to specifiy
> the help target in project. If the user tries to build a target that
> doesn't exist they can then be told to run "ant <insertname of help
> target>" to get help or else it could be automatically run.

ant -help works for ant related help. Other than that, I'm -1 on any "magic"
target names. In this case, mainly because help is info that should be
output to the user, not something that can potentially fire off a set of
tasks.

If a <help> or <about> section is being proposed to be added to the
<project> which would give info about this particular project, I'm not
opposed to that.

.duncan