1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-25 08:38:39 +02:00
audacity/src/commands/HelpCommand.cpp
martynshaw99 4ce2643d5f Remove the
// Indentation settings for Vim and Emacs
etc. lines from all files, as Campbell's patch (except for other changes to Languages.cpp)
2013-09-24 00:14:37 +00:00

48 lines
1.2 KiB
C++

/**********************************************************************
Audacity - A Digital Audio Editor
Copyright 1999-2009 Audacity Team
License: wxwidgets
Dan Horgan
******************************************************************//**
\file HelpCommand.cpp
\brief Definitions for HelpCommand and HelpCommandType classes
*//*******************************************************************/
#include "HelpCommand.h"
#include "CommandDirectory.h"
#include <wx/string.h>
wxString HelpCommandType::BuildName()
{
return wxT("Help");
}
void HelpCommandType::BuildSignature(CommandSignature &signature)
{
Validator *commandNameValidator = new Validator();
signature.AddParameter(wxT("CommandName"), wxT(""), commandNameValidator);
}
Command *HelpCommandType::Create(CommandOutputTarget *target)
{
return new HelpCommand(*this, target);
}
bool HelpCommand::Apply(CommandExecutionContext WXUNUSED(context))
{
wxString commandName = GetString(wxT("CommandName"));
CommandType *type = CommandDirectory::Get()->LookUp(commandName);
if (type == NULL)
{
Error(wxString::Format(wxT("Command '%s' does not exist!"), commandName.c_str()));
return false;
}
Status(type->Describe());
return true;
}