summaryrefslogtreecommitdiffstats
path: root/main.cxx
diff options
context:
space:
mode:
authorfche <fche>2005-08-10 20:25:35 +0000
committerfche <fche>2005-08-10 20:25:35 +0000
commitc0de7a8dc7987f0d1648e36085d328e290217aaa (patch)
tree30fb0c170c2b88faee491fba295e4b498c901edc /main.cxx
parentb5d770200feba14d6a33ce472a4246faecf5aee8 (diff)
downloadsystemtap-steved-c0de7a8dc7987f0d1648e36085d328e290217aaa.tar.gz
systemtap-steved-c0de7a8dc7987f0d1648e36085d328e290217aaa.tar.xz
systemtap-steved-c0de7a8dc7987f0d1648e36085d328e290217aaa.zip
2005-08-10 Frank Ch. Eigler <fche@elastic.org>
* tapsets.cxx: Correct hex/decimal misformatting of verbose messages. * main.cxx: Add formal "-h" and "-V" options. * stap.1.in: Document them.
Diffstat (limited to 'main.cxx')
-rw-r--r--main.cxx24
1 files changed, 18 insertions, 6 deletions
diff --git a/main.cxx b/main.cxx
index 7e2a1ec9..390816af 100644
--- a/main.cxx
+++ b/main.cxx
@@ -30,14 +30,21 @@ using namespace std;
void
-usage (systemtap_session& s)
+version ()
{
clog
<< "SystemTap translator/driver "
<< "(version " << VERSION << " built " << DATE << ")" << endl
<< "Copyright (C) 2005 Red Hat, Inc." << endl
<< "This is free software; see the source for copying conditions."
- << endl
+ << endl;
+}
+
+void
+usage (systemtap_session& s)
+{
+ version ();
+ clog
<< endl
<< "Usage: stap [options] FILE Run script in file."
<< endl
@@ -46,9 +53,11 @@ usage (systemtap_session& s)
<< " or: stap [options] -e SCRIPT Run given script."
<< endl
<< endl
- << "Arguments:" << endl
+ << "Options:" << endl
<< " -- no more options after this" << endl
- << " -v verbose" << (s.verbose ? " [set]" : "")
+ << " -v verbose" << (s.verbose ? " [set]" : "") << endl
+ << " -h show help" << endl
+ << " -V show version" << endl
<< endl
<< " -k keep temporary directory" << endl
// << " -t test mode" << (s.test_mode ? " [set]" : "") << endl
@@ -123,11 +132,15 @@ main (int argc, char * const argv [])
while (true)
{
- int grc = getopt (argc, argv, "vp:I:e:o:tR:r:m:kg");
+ int grc = getopt (argc, argv, "hVvp:I:e:o:tR:r:m:kg");
if (grc < 0)
break;
switch (grc)
{
+ case 'V':
+ version ();
+ exit (0);
+
case 'v':
s.verbose = true;
break;
@@ -180,7 +193,6 @@ main (int argc, char * const argv [])
s.guru_mode = true;
break;
- case '?':
case 'h':
default:
usage (s);