Line data Source code
1 : /**
2 : * @file
3 : *
4 : * @brief
5 : *
6 : * @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
7 : */
8 :
9 : #ifndef EXTERNAL_HPP
10 : #define EXTERNAL_HPP
11 :
12 : #include <stdexcept>
13 : #include <string>
14 :
15 : #include <command.hpp>
16 :
17 234 : struct UnknownCommand : std::exception
18 : {
19 : };
20 :
21 156 : class ExternalCommand : public Command
22 : {
23 78 : virtual std::string getShortOptions () override
24 : {
25 234 : return "";
26 : }
27 :
28 78 : virtual std::string getSynopsis () override
29 : {
30 234 : return "<anything>";
31 : }
32 :
33 78 : virtual std::string getShortHelpText () override
34 : {
35 234 : return "External command.";
36 : }
37 :
38 78 : virtual std::string getLongHelpText () override
39 : {
40 234 : return "";
41 : }
42 :
43 0 : virtual int execute (Cmdline const &) override
44 : {
45 0 : throw UnknownCommand ();
46 : }
47 : };
48 :
49 : void elektraExecve (const char * filename, char * const argv[]);
50 : void tryExternalCommand (char ** argv);
51 : void runManPage (std::string command = "", std::string profile = "current");
52 : bool runEditor (std::string editor, std::string file);
53 :
54 : #endif
|