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 <string>
14#include <vector>
15#include <set>
16#include <boost/shared_ptr.hpp>
17
18#include "options.hh"
19#include "vocab.hh"
20
21using boost::shared_ptr;
22
23// this defines a global function which processes command-line-like things,
24// possibly from the command line and possibly internal scripting if we ever
25// bind tcl or lua or something in here
26
27class app_state;
28class utf8;
29
30struct usage
31{
32 usage(std::string const & w) : which(w) {}
33 std::string which;
34};
35
36namespace commands {
37 void explain_usage(std::string const & cmd, std::ostream & out);
38 std::string complete_command(std::string const & cmd);
39 int process(app_state & app, std::string const & cmd, std::vector<utf8> const & args);
40 options::options_type command_options(std::vector<utf8> const & cmdline);
41 options::options_type toplevel_command_options(std::string const & cmd);
42};
43
44// Local Variables:
45// mode: C++
46// fill-column: 76
47// c-file-style: "gnu"
48// indent-tabs-mode: nil
49// End:
50// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:
51
52#endif

Archive Download this file

Branches

Tags

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