monotone

monotone Mtn Source Tree

Root/commands.hh

1#ifndef __COMMANDS_HH__
2#define __COMMANDS_HH__
3
4// Copyright (C) 2002 Graydon Hoare <graydon@pobox.com>
5//
6// This program is made available under the GNU GPL version 2.0 or
7// greater. See the accompanying file COPYING for details.
8//
9// This program is distributed WITHOUT ANY WARRANTY; without even the
10// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11// PURPOSE.
12
13#include "vector.hh"
14#include "options.hh"
15class app_state;
16class utf8;
17
18// this defines a global function which processes command-line-like things,
19// possibly from the command line and possibly internal scripting if we ever
20// bind tcl or lua or something in here
21
22namespace commands {
23 typedef std::vector< utf8 > command_id;
24
25 command_id make_command_id(std::string const & path);
26 void explain_usage(command_id const & cmd, std::ostream & out);
27 command_id complete_command(args_vector const & args);
28 void process(app_state & app, command_id const & ident,
29 args_vector const & args);
30 options::options_type command_options(command_id const & ident);
31};
32
33struct usage
34{
35 usage(commands::command_id const & w) : which(w) {}
36 commands::command_id which;
37};
38
39// Local Variables:
40// mode: C++
41// fill-column: 76
42// c-file-style: "gnu"
43// indent-tabs-mode: nil
44// End:
45// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:
46
47#endif

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status