3 Commits

Author SHA1 Message Date
Cametendo
4ed8cdc792 Fixed blocksize and oflag and only supporting number
in both the CLI version aswell as the TUI version
2026-04-23 14:40:36 +02:00
Cametendo
23f5ff77ec Fixed blocksize and oflag and only supporting number
in both the CLI version aswell as the TUI version
2026-04-23 14:26:32 +02:00
Cametendo
ee7c2ba46b Fix 'Program doesnt close when saying i dont want to flash a image' 2026-04-23 11:41:23 +02:00
6 changed files with 49 additions and 40 deletions

3
.gitignore vendored
View File

@@ -35,4 +35,5 @@ hs_err_pid*
.classpath
.project
.settings/
.vscode/
.vscode/
PKGBUILD

55
pom.xml
View File

@@ -6,7 +6,7 @@
<groupId>org.cametendo</groupId>
<artifactId>cflash</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.1</version>
<properties>
<maven.compiler.source>21</maven.compiler.source>
@@ -23,30 +23,33 @@
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<archive>
<manifest>
<mainClass>org.cametendo.Main</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<archive>
<manifest>
<mainClass>org.cametendo.Main</mainClass>
</manifest>
<manifestEntries>
<Enable-Native-Access>ALL-UNNAMED</Enable-Native-Access>
</manifestEntries>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -7,12 +7,12 @@ public class BlockSize {
public static String mapBlockSize(String input) {
return switch (input) {
case "1" -> "512K";
case "2" -> "1M";
case "3" -> "2M";
case "4" -> "4M";
case "5" -> "8M";
case "6" -> "16M";
case "1", "512K" -> "512K";
case "2", "1M" -> "1M";
case "3", "2M" -> "2M";
case "4", "4M" -> "4M";
case "5", "8M" -> "8M";
case "6", "16M" -> "16M";
default -> blockSizeString;
};
}

View File

@@ -6,7 +6,13 @@ public class Greeting {
public static void greeting(Scanner UserInput) {
System.out.println("Welcome to cflash!");
System.out.println("Would you like to flash an image (Y/n)");
UserInput.nextLine();
String input = UserInput.nextLine();
if (YesNo.check(input)) {
System.out.println("Please choose the to be flashed device (f. e. sda)");
} else {
System.out.println("Canceling...");
System.exit(0);
}
}
}

View File

@@ -23,7 +23,7 @@ public class Main {
} else {
Greeting.greeting(UserInput);
StorageDeviceLister.deviceCheck(UserInput);
FilePathAdd.filePath();
BlockSize.blockSize(UserInput);

View File

@@ -7,11 +7,10 @@ public class OflagHandler {
public static String mapOflagHandle(String input) {
return switch (input) {
case "1" -> "direct";
case "2" -> "dsync";
case "3" -> "sync";
case "4" -> "nocache";
case "5" -> "direct";
case "1", "direct" -> "direct";
case "2", "dsync" -> "dsync";
case "3", "sync" -> "sync";
case "4", "nocache" -> "nocache";
default -> oflagHandleString;
};
}