usage

Package: WA2L/edrc 1.5.57
Section: General Commands (1)
Updated: 24 January 2009
Index Return to Main Contents

 

NAME

usage - print short usage or command/alias cmd

 

SYNOPSIS

edrc/bin/usage [ -h | -t ]

usage [ what ]

 

AVAILABILITY

WA2L/edrc

 

DESCRIPTION

print a short usage of additional commands and aliases available on the system which are not common on the operating system.

To print the usage of the additional commands, all ASCII files in the defined directories and the user login files $ENV and $HOME/.cshrc (depending on the used shell) are searched for the pattern # usage: command ... .

To list commands in the usage output, add the following line to your commands:

  # usage: my_command [ options ]      - short command description

Ensure that the alignment is precisely done as in this example, otherwise the output of usage is not aligned and looks messy.

For binary files or not self developed commands to be listed with usage the convention is to add a usage.list file into a searched directory containing the # usage: entries.

Add the [helper] "tag" to the usage string

  # usage: my_command [ options ]      - [helper] short command description

to indicate that the command is not a fully honed command, but a "helper" script which provides output or functionality which needs further manual intervention.

 

OPTIONS

-h
usage message. The usage message also prints a template of the searched # usage: string that can be added to new commands.

-t
print usage entry template.

what
select commands starting with what from the whole usage list output.

 

ENVIRONMENT

$USAGE_PATH
colon separated path of directories where to scan files for the # usage: pattern and to search for the usage.list files.

If $USAGE_PATH is not set the directories edrc/bin/, edrc/lib/, edrc/lib/ksh/, edrc/lib/perl/, edrc/lib/python/, edrc/lib/lua/ and edrc/lib/daemon/ are searched by default.

 

EXIT STATUS

0
no error.

4
usage printed.

 

FILES

usage.list
usage list of 3rd party commands or compiled commands.

$HOME/.cshrc
C-shell initialization file.

$ENV
Bourne-, Bourne-Again shell initialization file.

 

EXAMPLES

-

 

SEE ALSO

edrcintro(1), edrcman(1), name(1), revision(1), usage.list(4)

 

NOTES

-

 

BUGS

-

 

AUTHOR

usage was developed by Christian Walther. Send suggestions and bug reports to wa2l@users.sourceforge.net .

 

COPYRIGHT

Copyright © 2009 Christian Walther

This is free software; see edrc/doc/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


 

Index

NAME
SYNOPSIS
AVAILABILITY
DESCRIPTION
OPTIONS
ENVIRONMENT
EXIT STATUS
FILES
EXAMPLES
SEE ALSO
NOTES
BUGS
AUTHOR
COPYRIGHT

This document was created by man2html using the manual pages.
Time: 15:53:21 GMT, April 30, 2025