source: molecuilder/src/Actions/CmdAction/HelpAction.cpp@ ae8b90

Last change on this file since ae8b90 was ae8b90, checked in by Frederik Heber <heber@…>, 16 years ago

New HelpAction that will print the help from boost::program_options.

  • new class CommandLineHelpAction that will print the boost::program_options help
  • therefore CommandLineParser::visible had to be made public
  • CommandLineHelpAction is instantiated in CommandLineWindow::populateParserActions()
  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 * HelpAction.cpp
3 *
4 * Created on: May 8, 2010
5 * Author: heber
6 */
7
8#include "Actions/CmdAction/HelpAction.hpp"
9#include "CommandLineParser.hpp"
10
11#include <iostream>
12#include <string>
13
14using namespace std;
15
16#include "UIElements/UIFactory.hpp"
17#include "UIElements/Dialog.hpp"
18
19const char CommandLineHelpAction::NAME[] = "help";
20
21CommandLineHelpAction::CommandLineHelpAction() :
22 Action(NAME)
23{}
24
25CommandLineHelpAction::~CommandLineHelpAction()
26{}
27
28Action::state_ptr CommandLineHelpAction::performCall() {
29 Dialog *dialog = UIFactory::getInstance().makeDialog();
30
31 cout << CommandLineParser::getInstance().visible << endl;
32
33 delete dialog;
34 return Action::failure;
35}
36
37Action::state_ptr CommandLineHelpAction::performUndo(Action::state_ptr _state) {
38// ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
39
40 return Action::failure;
41// string newName = state->mol->getName();
42// state->mol->setName(state->lastName);
43//
44// return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
45}
46
47Action::state_ptr CommandLineHelpAction::performRedo(Action::state_ptr _state){
48 return Action::failure;
49}
50
51bool CommandLineHelpAction::canUndo() {
52 return false;
53}
54
55bool CommandLineHelpAction::shouldUndo() {
56 return false;
57}
58
59const string CommandLineHelpAction::getName() {
60 return NAME;
61}
Note: See TracBrowser for help on using the repository browser.