diff --git a/src/cli/extract.cpp b/src/cli/extract.cpp index 52b802e..cb024c2 100644 --- a/src/cli/extract.cpp +++ b/src/cli/extract.cpp @@ -633,7 +633,7 @@ bool print_file_info(const extract_options & o, const setup::info & info) { if(!o.quiet && multiple_sections) { std::cout << '\n'; } - + if(o.list_languages) { if(o.silent) { BOOST_FOREACH(const setup::language_entry & language, info.languages) { @@ -768,7 +768,13 @@ processed_entries filter_entries(const extract_options & o, const setup::info & } else if(o.language_only) { continue; // Ignore language-agnostic dirs } - + + if(!directory.components.empty()) { + if(!o.component.empty() && !setup::expression_match(o.component, directory.components)) { + continue; + } + } + std::string path = o.filenames.convert(directory.name); if(path.empty()) { continue; // Don't know what to do with this @@ -813,7 +819,13 @@ processed_entries filter_entries(const extract_options & o, const setup::info & } else if(o.language_only) { continue; // Ignore language-agnostic files } - + + if (!file.components.empty()) { + if (!o.component.empty() && !setup::expression_match(o.component, file.components)) { + continue; + } + } + std::string path = o.filenames.convert(file.destination); if(path.empty()) { continue; // Internal file, not extracted diff --git a/src/cli/extract.hpp b/src/cli/extract.hpp index e206e5c..748814b 100644 --- a/src/cli/extract.hpp +++ b/src/cli/extract.hpp @@ -77,6 +77,7 @@ struct extract_options { bool extract_unknown; //!< Try to extract unknown Inno Setup versions + std::string component; //!< Extract only files for this component bool extract_temp; //!< Extract temporary files bool language_only; //!< Extract files not associated with any language std::string language; //!< Extract only files for this language diff --git a/src/cli/main.cpp b/src/cli/main.cpp index 213b492..fc43710 100644 --- a/src/cli/main.cpp +++ b/src/cli/main.cpp @@ -165,6 +165,7 @@ int main(int argc, char * argv[]) { po::options_description filter("Filters"); filter.add_options() + ("component", po::value(), "Extract only files for this component") ("exclude-temp,m", "Don't extract temporary files") ("language", po::value(), "Extract only files for this language") ("language-only", "Only extract language-specific files") @@ -355,6 +356,12 @@ int main(int argc, char * argv[]) { } o.language_only = (options.count("language-only") != 0); } + { + po::variables_map::const_iterator i = options.find("component"); + if(i != options.end()) { + o.component = i->second.as(); + } + } { po::variables_map::const_iterator i = options.find("include"); if(i != options.end()) {