File: usage.cc

package info (click to toggle)
yodl 4.04.00-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,720 kB
  • sloc: ansic: 7,803; perl: 683; cpp: 570; sh: 411; xml: 190; makefile: 164
file content (46 lines) | stat: -rw-r--r-- 1,170 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//                     usage.cc

#include "main.ih"

namespace {
    char const *info = 
R"(
Where:
 [options] - optional arguments (short options between parentheses):
   -a      process all lines, //marker may not be specified
   -A      same as -a, all marker lines are skipped
   -n      write line numbers
   -N      no newline after verb(
   -s<nr>  indent lines with <nr> space characters
   -t<nr>  indent lines with <nr> tab characters (before spaces)
   -S<nr>  indent verb( and final ) with <nr> space characters
   -T<nr>  indent verb( and final ) with <nr> tab characters (before spaces)
   -V      do not add verb( ... ) 

   //marker target marker (not with -a, -A options)
   file     file to be process

Output is written to the std output stream. 

Returns 1 at errors, including showing this usage information. Error output is
written to the std error stream.
)";

}   // namespace

void usage(std::string const &progname)
{
    cerr << "\n" <<
    progname << " by " << author << "\n" <<
    progname << " V" << version << " " << years << "\n"
    "\n"
    "Usage: " << progname << " [options] [//marker] file" << info << '\n';

    throw 1;
}