Reference: Command Line
Move Up Move to Top Move to Prev
Contents: Command Line Info Project Options
Task Options Batch NNTP Operations
NewsRog CmdLine Info The NewsRog command line exists for several purposes:

  • Controlling the startup environment of NewsRog, such as specifying certain project files or the priority of the NewsRog task.

  • Accessing an NNTP server in batch mode.

The first type option can also be used in an AmigaOS icon tooltype. Consult your Amiga documentation for more information on tooltypes.

Running NewsRog from the command line with a question mark as an option (NewsRog ?) will print an options template. The case of options is not significant, and either a space or an equals sign can separate options from their values; the following are synonymous:

    STARTPROJ=ram:Project.Test
    STARTPROJ ram:Project.Test

Many options have shorter synonyms, such as SP=STARTPROJ.

Back to Top

Project Commands The following command line options deal with projects:

OptionParametersDescription
STARTPROJ
SP
Filename Specifies the filename of the project to be loaded into NewsRog. If omitted, and the NOPROJ option is not used, then the defaul NewsRog project is loaded if it exists.
NOPROJ
NP
None Specifies that no project should be loaded when NewsRog starts. This overrides the STARTPROJ option.
HELP
USAGE
None Prints command line usage template to stdout and exits.

Back to Top

Task Commands The following command line options relate to the NewsRog task:

OptionParametersDescription
TASKPRI
TP
Priority The task priority of the NewsRog task is set to this value.
CX_PRI
NP
Priority The commodities exchange priority of the NewsRog task is set to this value.
ONLINEMODE
ON
None NewsRog is started in online mode. If neither this nor OFFLINEMODE is given, then the value stored in the initial project file, if any, is used.
OFFLINEMODE
OFF
None NewsRog is started in offline mode. If neither this nor ONLINEMODE is given, then the value stored in the initial project file, if any, is used.
NOBANNER
NB
None Disables display of the NewsRog startup end exit banners.
NOBANNERIMG
NBI
None Enables display of the startup end exit banners, but disables display of the graphic logo in the banner, which may be advantageous for very slow machines.
BUTTONPATH
NBI
Path This option can be set to a comma separated list of pathnames, from which NewsRog will try to load button images before using the default location of PROGDIR:Images. The filenames must match exactly with the ones in PROGDIR:Images, and any mask images must be present in the same directory as the image itself. This option is provided for people who wish to use alternate sets of button imagery with NewsRog. If not all the images are provided, the ones not found will be loaded from the default location.

Back to Top

Batch NNTP Operations NewsRog can be used in a batch mode where commands are sent to the NNTP server and the results are printed on the standard output. In this manner, it is possible to use NewsRog as part of a shell script or ARexx script.

If any of these batch options are present on the command line, then NewsRog exits after performing the indicated option. No project is loaded and the NewsRog user interface does not appear. Batch options may be used even if an interactive NewsRog is currently running. Batch operations may only be performed if a networking stack is present and online. Currently, the batch mode is not useable with servers that require NNTP authentication.

All of the batch NNTP operations require a server name. The following strategy is used to find the name of the NNTP server with which to communicate.

  • A server name specified with the SERVER option is used if present.

  • The value of the NNTPSERVER environment variable is used, if defined.

  • Lastly, the value news is used as a server name. This can work if you have an alias set up in your IP software.

For example, this command line fetches a particular article by Message-ID from the news server named news.mydomain.com and prints the result on the standard output:

    NewsRog SRV news.mydomain.com MSGID "<some.message.id@foo.bar.com>"

while the following performs the same command using the server defined in NNTPSERVER, or "news" otherwise:

    NewsRog MSGID "<some.message.id@foo.bar.com>"

In the rest of the examples on this page, the SRV option has been omitted for brevity, but may be used together with any other batch command.

Many commands refer to Message-ID's. Message-ID's are unique strings enclosed in angle brackets which refer to a particular usenet article. A particular article's Message-ID is the same no matter which server it resides on, and every article has its own Message-ID.

It is possible to check for the existance of a particular article by using the CHECK switch. In this case, NewsRog produces no output but exits with a return code of zero (0) if the article was found, or one (1) otherwise:

    NewsRog MSGID <message-id> CHECK
To return just the value of a particular header from a particular article, use the HDR option:

    NewsRog MSGID <message-id> HDR From

Any valid usenet header name may be given. NewsRog will output the value of the given header in the given article, if found, without the field name itself. The header name is not case sensitive.

OperationDescription
Fetching Articles The basic command to return a news article given it's Message-ID is:

NewsRog MSGID <messageid>

If the given message-id does not contain angle brackets, NewsRog will supply them itself before sending the command to the server. This reduces the need to quote message-id's to avoid shell I/O redirection. If the angle brackets are given, surround the message id in double quotes.

There are optional switches for returning just the article's headers, just the body, or the whole article (which is the default):

    NewsRog MSGID <message-id> HEAD
    NewsRog MSGID <message-id> BODY
    NewsRog MSGID <message-id> ART
Testing Articles
Finding a Header Value
Listing Groups The groups on the server which match a particular pattern may be listed via:

    NewsRog LISTGROUPS wildmat

Where wildmat is a simplified wildcard format supporting "*" and a few other wildcard characters. For example, to return a listing of the Amiga related newsgroups:

    NewsRog LISTGROUPS *amiga*
Listing Message ID's in a group A listing of Message-ID's in a particular newsgroup may be generated via:

    NewsRog GROUP groupname LISTMSGIDS

Where groupname is the name of a valid usenet group.

Testing Groups The existance of a particular newsgroup may be checked via:

    NewsRog GROUP groupname CHECK

Where groupname is the name of a valid usenet group. NewsRog produces no output but exits with a return code of zero (0) if the group was found on the server, or one (1) otherwise.

Counting Group Articles The approximate count of articles in a newsgroup may be obtained via:
    NewsRog GROUP groupname ARTCOUNT

Where groupname is the name of a valid usenet group. The approximate count of articles in the group is printed on the standard output. This count is only approximate due to the manner in which NNTP is defined The number of articles in the group will not exceed this value, although it may be less.

Searching through Articles To search through the bodies of all articles in a group for a specific AmigaOS pattern:

    NewsRog GROUP groupname SEARCH pattern

Where groupname is the name of a valid usenet group, and pattern is an AmigaOS pattern. The Message-IDs of articles containing that pattern will be printed to stdout.

To instead print the Subject (or some other) header of matching articles, use the SEARCHRES option, like this:

    NewsRog GROUP comp.sys.amiga.misc SEARCH NewsRog SEARCHRES Subject

A special value MATCH to the SEARCHRES option will print all lines that match the pattern. To make the search case sensitive, use the MATCHCASE switch. To print articles that do not contain a match for the pattern, use the INVERT switch:

    NewsRog GROUP groupname SEARCH pattern MATCHCASE
    NewsRog GROUP groupname SEARCH pattern INVERT

To search through all header field, use:

    NewsRog GROUP groupname SEARCH pattern HEAD

To search through a particular header field for each article:

    NewsRog GROUP groupname SEARCH pattern HEADER header


Back to Top