summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2013-05-22 20:36:38 +0100
committerLars Wirzenius <liw@liw.fi>2013-05-22 20:36:38 +0100
commit7671fc78cb1f6e26cf7ad29e8bd51743ff2e828e (patch)
treeca27e254aa1d52dba66dc349d0b89b37ad4ee12f
parent88cc3b44662b5179506e77fb570d75122ecf56e4 (diff)
downloadcliapp-7671fc78cb1f6e26cf7ad29e8bd51743ff2e828e.tar.gz
Document subcommands and subcommand help
-rw-r--r--NEWS6
-rw-r--r--cliapp.529
2 files changed, 34 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 6869e1b..754125b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,12 @@
NEWS for cliapp
===============
+Version 1.UNRELEASED
+--------------------
+
+* cliapp(5) now mentions subcommands and the automatic subcommand
+ "help".
+
Version 1.20130424
------------------
diff --git a/cliapp.5 b/cliapp.5
index 4a87723..509c2b4 100644
--- a/cliapp.5
+++ b/cliapp.5
@@ -1,4 +1,4 @@
-.\" Copyright (C) 2011, 2012 Lars Wirzenius
+ .\" Copyright (C) 2011, 2012 Lars Wirzenius
.\"
.\" This program is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
@@ -228,6 +228,33 @@ You would keep the source code for the manual page in
and have your Makefile produce
.I foo.1
as shown above.
+.SS "Subcommands"
+.BR cliapp
+provides a way for the application to have
+.IR subcommands ,
+in the style of
+.BR git (1),
+for example.
+If the application is called
+.IR foo ,
+then it can have subcommands such as
+.IR "foo search" ,
+and
+.IR "foo print" .
+The application gets to define the name and meaning of each subcommand.
+However,
+all settings (options and configuration files) are global,
+and can be used with all subcommands.
+It is up to each subcommand what settings it obeys.
+.PP
+If there are any subcommands,
+.B cliapp
+automatically adds the
+.B help
+subcommand.
+It allows you to get the help text for a specific subommand:
+.IR "foo help print" ,
+for example.
.SH FILES
.B cliapp
reads a list of configuration files at startup,