mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-18 19:06:10 +00:00
Add -F command line option to specify Format (#1946)
This commit is contained in:
parent
7dbdd65740
commit
58b44893f9
@ -80,6 +80,11 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc
|
||||
QObject::tr("level"));
|
||||
cmd_parser.addOption(analOption);
|
||||
|
||||
QCommandLineOption formatOption({"F", "format"},
|
||||
QObject::tr("Force using a specific file format (bin plugin)"),
|
||||
QObject::tr("name"));
|
||||
cmd_parser.addOption(formatOption);
|
||||
|
||||
QCommandLineOption scriptOption("i",
|
||||
QObject::tr("Run script file"),
|
||||
QObject::tr("file"));
|
||||
@ -178,6 +183,7 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc
|
||||
} else { // filename specified as positional argument
|
||||
InitialOptions options;
|
||||
options.filename = args[0];
|
||||
options.forceBinPlugin = cmd_parser.value(formatOption);
|
||||
if (analLevelSpecified) {
|
||||
switch (analLevel) {
|
||||
case 0:
|
||||
|
@ -153,6 +153,12 @@ void InitialOptionsDialog::loadOptions(const InitialOptions &options)
|
||||
|
||||
shellcode = options.shellcode;
|
||||
|
||||
if (!options.forceBinPlugin.isEmpty()) {
|
||||
ui->formatComboBox->setCurrentText(options.forceBinPlugin);
|
||||
} else {
|
||||
ui->formatComboBox->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
// TODO: all other options should also be applied to the ui
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user