Line data Source code
1 : /**
2 : * @file
3 : *
4 : * @brief header file of mount command
5 : *
6 : * @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
7 : *
8 : */
9 :
10 :
11 : #ifndef MOUNT_HPP
12 : #define MOUNT_HPP
13 :
14 : #include <mountbase.hpp>
15 :
16 : namespace kdb
17 : {
18 : namespace tools
19 : {
20 : class MountBackendInterface;
21 : }
22 : } // namespace kdb
23 :
24 : class MountCommand : public MountBaseCommand
25 : {
26 : void outputMtab (Cmdline const & cl);
27 : void processArguments (Cmdline const & cl);
28 : void buildBackend (Cmdline const & cl);
29 : void appendPlugins (kdb::tools::MountBackendInterface & backend);
30 : void readPluginConfig (kdb::KeySet & config);
31 :
32 : public:
33 : MountCommand ();
34 : ~MountCommand ();
35 :
36 307 : virtual std::string getShortOptions () override
37 : {
38 921 : return "fqisR0123cW";
39 : }
40 :
41 307 : virtual std::string getSynopsis () override
42 : {
43 921 : return "[path mountpoint] [plugin [config] [..]]";
44 : }
45 :
46 385 : virtual std::string getShortHelpText () override
47 : {
48 1155 : return "Mount a new backend.";
49 : }
50 :
51 307 : virtual std::string getLongHelpText () override
52 : {
53 : return "path .. a filename (absolute for system, relative for cascading or user)\n"
54 : "mountpoint .. where to mount the backend, start with / for cascading mp\n"
55 : "plugin .. a list of plugins and their config to mount at that place\n"
56 : " Each plugin my be followed by a (,-sep) list of keys and corresponding values that will be\n"
57 : " written below the backend config. For example param1=value1,param2=value2\n"
58 : "\n"
59 : "With the -i option, the mounting will be done interactively\n"
60 : "\n"
61 : "With no arguments and not in interactive mode, the current mountpoints will be listed\n"
62 : "Then the options -0123 take effect (otherwise these options can be used to suppress warnings).\n"
63 921 : "1,2 and 3 will suppress the output of the respective column\n";
64 : }
65 :
66 : virtual int execute (Cmdline const & cmdline) override;
67 : };
68 :
69 : #endif
|