~ubuntu-branches/ubuntu/intrepid/schroot/intrepid

« back to all changes in this revision

Viewing changes to schroot/schroot-options.h

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2006-07-08 18:33:28 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060708183328-rlo4mpldmyoda55q
Tags: 0.99.2-2ubuntu1
* remerge ubuntu changes:
  + debian/control: libpam-dev (>> 0.79-3ubuntu6)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#ifndef SCHROOT_OPTIONS_H
21
21
#define SCHROOT_OPTIONS_H
22
22
 
23
 
#include <string>
24
 
#include <vector>
25
 
 
26
 
#include "sbuild-session.h"
27
 
#include "sbuild-types.h"
 
23
#include <schroot/schroot-options-base.h>
28
24
 
29
25
namespace schroot
30
26
{
32
28
  /**
33
29
   * schroot command-line options.
34
30
   */
35
 
  class options
 
31
  class options : public options_base
36
32
  {
37
33
  public:
38
 
    /// The action to perform.
39
 
    enum action_type
40
 
      {
41
 
        ACTION_SESSION_AUTO,    ///< Begin, run and end a session.
42
 
        ACTION_SESSION_BEGIN,   ///< Begin a session.
43
 
        ACTION_SESSION_RECOVER, ///< Recover an existing session.
44
 
        ACTION_SESSION_RUN,     ///< Run an existing session.
45
 
        ACTION_SESSION_END,     ///< End an existing session.
46
 
        ACTION_VERSION,         ///< Display program version.
47
 
        ACTION_LIST,            ///< Display a list of chroots.
48
 
        ACTION_INFO,            ///< Display chroot information.
49
 
        ACTION_LOCATION,        ///< Display chroot location information.
50
 
        ACTION_CONFIG           ///< Display chroot configuration.
51
 
      };
52
 
 
53
34
    /**
54
35
     * The constructor.
55
36
     *
56
37
     * @param argc the number of arguments.
57
38
     * @param argv the list of arguments.
58
39
     */
59
 
    options (int   argc,
60
 
             char *argv[]);
 
40
    options ();
61
41
 
62
42
    /// The destructor.
63
43
    virtual ~options ();
64
44
 
65
 
    /// The action to perform.
66
 
    action_type          action;
67
 
    /// Chroots to use.
68
 
    sbuild::string_list  chroots;
69
 
    /// Chroot to print path.
70
 
    std::string          chroot_path;
71
 
    /// Command to run.
72
 
    sbuild::string_list  command;
73
 
    /// User to run as.
74
 
    std::string          user;
75
 
    /// Preserve environment.
76
 
    bool                 preserve;
77
 
    /// Quiet messages.
78
 
    bool                 quiet;
79
 
    /// Verbose messages.
80
 
    bool                 verbose;
81
 
    /// Use all chroots and sessions.
82
 
    bool                 all;
83
 
    /// Use all chroots.
84
 
    bool                 all_chroots;
85
 
    /// Use all sessions.
86
 
    bool                 all_sessions;
87
 
    /// Load chroots.
88
 
    bool                 load_chroots;
89
 
    /// Load sessions.
90
 
    bool                 load_sessions;
91
 
    /// Force session operations.
92
 
    bool                 session_force;
93
 
    /// dchroot(1) compatibility mode.
94
 
    bool                 dchroot_compat;
95
 
 
96
 
  private:
97
 
    /**
98
 
     * Set action.  This detects if an action has already been set
99
 
     * (only one action may be specified at once).
100
 
     *
101
 
     * @param action the action to set.
102
 
     */
103
 
    void
104
 
    set_action (action_type action);
105
 
 
106
 
    /**
107
 
     * Check if any of the --all options have been used.
108
 
     *
109
 
     * @returns true if any of the options have been used, otherwise
110
 
     * false.
111
 
     */
112
 
    bool
113
 
    all_used () const
114
 
    {
115
 
      return (this->all || this->all_chroots || this->all_sessions);
116
 
    }
117
 
 
 
45
  protected:
 
46
    virtual void
 
47
    add_options ();
 
48
 
 
49
    virtual void
 
50
    check_options ();
118
51
  };
119
52
 
120
53
}