diff options
author | Caroline Tice <ctice@apple.com> | 2010-10-04 22:28:36 +0000 |
---|---|---|
committer | Caroline Tice <ctice@apple.com> | 2010-10-04 22:28:36 +0000 |
commit | 405fe67f1424284173459575b1081f42935c50fd (patch) | |
tree | 5110616e8a6ebcd9138f08209dbacf041b50a37a /lldb/source/Commands/CommandObjectCommands.cpp | |
parent | 3703ff41632ea5f5749f35fe380edc8872f34d6d (diff) | |
download | llvm-405fe67f1424284173459575b1081f42935c50fd.zip llvm-405fe67f1424284173459575b1081f42935c50fd.tar.gz llvm-405fe67f1424284173459575b1081f42935c50fd.tar.bz2 |
Modify existing commands with arguments to use the new argument mechanism
(for standardized argument names, argument help, etc.)
llvm-svn: 115570
Diffstat (limited to 'lldb/source/Commands/CommandObjectCommands.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectCommands.cpp | 62 |
1 files changed, 59 insertions, 3 deletions
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index f21938f..514d6a4 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -35,8 +35,20 @@ public: CommandObject (interpreter, "commands source", "Read in debugger commands from the file <filename> and execute them.", - "command source <filename>") + NULL) { + CommandArgumentEntry arg; + CommandArgumentData file_arg; + + // Define the first (and only) variant of this arg. + file_arg.arg_type = eArgTypeFilename; + file_arg.arg_repetition = eArgRepeatPlain; + + // There is only one variant this argument could be; put it into the argument entry. + arg.push_back (file_arg); + + // Push the data for the first argument into the m_arguments vector. + m_arguments.push_back (arg); } ~CommandObjectCommandsSource () @@ -139,7 +151,7 @@ public: CommandObject (interpreter, "commands alias", "Allow users to define their own debugger command abbreviations.", - "commands alias <new_command> <old_command> [<options-for-aliased-command>]") + NULL) { SetHelpLong( "'alias' allows the user to create a short-cut or abbreviation for long \n\ @@ -189,6 +201,38 @@ public: \n commands alias bl3 breakpoint set -f %1 -l 3 // Always sets a breakpoint on line \n\ // 3 of whatever file is indicated. \n"); + CommandArgumentEntry arg1; + CommandArgumentEntry arg2; + CommandArgumentEntry arg3; + CommandArgumentData alias_arg; + CommandArgumentData cmd_arg; + CommandArgumentData options_arg; + + // Define the first (and only) variant of this arg. + alias_arg.arg_type = eArgTypeAliasName; + alias_arg.arg_repetition = eArgRepeatPlain; + + // There is only one variant this argument could be; put it into the argument entry. + arg1.push_back (alias_arg); + + // Define the first (and only) variant of this arg. + cmd_arg.arg_type = eArgTypeCommandName; + cmd_arg.arg_repetition = eArgRepeatPlain; + + // There is only one variant this argument could be; put it into the argument entry. + arg2.push_back (cmd_arg); + + // Define the first (and only) variant of this arg. + options_arg.arg_type = eArgTypeAliasOptions; + options_arg.arg_repetition = eArgRepeatOptional; + + // There is only one variant this argument could be; put it into the argument entry. + arg3.push_back (options_arg); + + // Push the data for the first argument into the m_arguments vector. + m_arguments.push_back (arg1); + m_arguments.push_back (arg2); + m_arguments.push_back (arg3); } ~CommandObjectCommandsAlias () @@ -352,8 +396,20 @@ public: CommandObject (interpreter, "commands unalias", "Allow the user to remove/delete a user-defined command abbreviation.", - "unalias <alias-name-to-be-removed>") + NULL) { + CommandArgumentEntry arg; + CommandArgumentData alias_arg; + + // Define the first (and only) variant of this arg. + alias_arg.arg_type = eArgTypeAliasName; + alias_arg.arg_repetition = eArgRepeatPlain; + + // There is only one variant this argument could be; put it into the argument entry. + arg.push_back (alias_arg); + + // Push the data for the first argument into the m_arguments vector. + m_arguments.push_back (arg); } ~CommandObjectCommandsUnalias() |