1 //===-- OptionGroupOutputFile.cpp -------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "lldb/Interpreter/OptionGroupOutputFile.h"
14 // Other libraries and framework includes
16 #include "lldb/Utility/Utils.h"
19 using namespace lldb_private;
21 OptionGroupOutputFile::OptionGroupOutputFile() :
23 m_append (false, false)
27 OptionGroupOutputFile::~OptionGroupOutputFile ()
31 static OptionDefinition
34 { LLDB_OPT_SET_1 , false, "outfile", 'o', required_argument, NULL, 0, eArgTypeFilename , "Specify a path for capturing command output."},
35 { LLDB_OPT_SET_1 , false, "append-outfile" , 'apnd', no_argument, NULL, 0, eArgTypeNone , "Append to the the file specified with '--outfile <path>'."},
39 OptionGroupOutputFile::GetNumDefinitions ()
41 return llvm::array_lengthof(g_option_table);
44 const OptionDefinition *
45 OptionGroupOutputFile::GetDefinitions ()
47 return g_option_table;
51 OptionGroupOutputFile::SetOptionValue (CommandInterpreter &interpreter,
53 const char *option_arg)
56 const int short_option = g_option_table[option_idx].short_option;
61 error = m_file.SetValueFromCString (option_arg);
65 m_append.SetCurrentValue(true);
69 error.SetErrorStringWithFormat ("unrecognized option '%c'", short_option);
77 OptionGroupOutputFile::OptionParsingStarting (CommandInterpreter &interpreter)