Skip to content

Commit

Permalink
devonfw#10: improve IDE support and configure workspace (devonfw#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
hohwille authored Nov 16, 2023
1 parent ad2f006 commit 489c8d6
Show file tree
Hide file tree
Showing 47 changed files with 1,148 additions and 1,610 deletions.
33 changes: 33 additions & 0 deletions cli/src/main/java/com/devonfw/tools/ide/cli/CliArgument.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,4 +213,37 @@ public static CliArgument of(boolean splitShortOpt, String... args) {
return first;
}

/**
* @param firstArgs the first arguments.
* @param nextArgs the additional arguments to append after {@code args}.
* @return a {@link String} array with the values from {@code firstArgs} followed by the values from {@code nextArgs}.
*/
public static String[] append(String[] firstArgs, String... nextArgs) {

return join(firstArgs, false, nextArgs);
}

/**
* @param nextArgs the arguments to append after {@code firstArgs}.
* @param firstArgs the first arguments.
* @return a {@link String} array with the values from {@code firstArgs} followed by the values from {@code nextArgs}.
*/
public static String[] prepend(String[] nextArgs, String... firstArgs) {

return join(nextArgs, false, firstArgs);
}

private static String[] join(String[] args, boolean prefix, String... extraArgs) {

String[] result = new String[args.length + extraArgs.length];
int argsStart = 0;
int extraArgsStart = args.length;
if (prefix) {
argsStart = extraArgs.length;
extraArgsStart = 0;
}
System.arraycopy(args, 0, result, argsStart, args.length);
System.arraycopy(extraArgs, 0, result, extraArgsStart, extraArgs.length);
return result;
}
}
2 changes: 1 addition & 1 deletion cli/src/main/java/com/devonfw/tools/ide/cli/Ide.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public int run(String... args) {
} catch (CliException error) {
exitStatus = error.getExitCode();
if (context().level(IdeLogLevel.DEBUG).isEnabled()) {
context().error(error.getMessage(), error);
context().error(error, error.getMessage());
} else {
context().error(error.getMessage());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
public final class HelpCommandlet extends Commandlet {

protected static final String LOGO = """
static final String LOGO = """
__ ___ ___ ___
╲ ╲ |_ _| ╲| __|__ _ ____ _
> > | || |) | _|/ _` (_-< || |
Expand Down
80 changes: 0 additions & 80 deletions cli/src/main/java/com/devonfw/tools/ide/configurator/Args.java

This file was deleted.

Loading

0 comments on commit 489c8d6

Please sign in to comment.