• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

LearnLib / learnlib / 31519345371

11 Aug 2026 05:47PM UTC coverage: 95.501% (+0.2%) from 95.334%
31519345371

Pull #166

github

web-flow
Merge 35e16c033 into 6c9a24bf8
Pull Request #166: LearnLib CLI

685 of 703 new or added lines in 31 files covered. (97.44%)

15538 of 16270 relevant lines covered (95.5%)

1.72 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.33
/cli/src/main/java/de/learnlib/cli/Application.java
1
/* Copyright (C) 2013-2026 TU Dortmund University
2
 * This file is part of LearnLib <https://learnlib.de>.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package de.learnlib.cli;
17

18
import ch.qos.logback.classic.Level;
19
import ch.qos.logback.classic.Logger;
20
import de.learnlib.cli.option.Options;
21
import de.learnlib.cli.util.VersionProvider;
22
import org.slf4j.LoggerFactory;
23
import picocli.CommandLine;
24
import picocli.CommandLine.Command;
25
import picocli.CommandLine.Mixin;
26

27
@Command(name = "learnlib",
28
         mixinStandardHelpOptions = true,
29
         versionProvider = VersionProvider.class,
30
         resourceBundle = Application.PROPERTIES,
31
         showDefaultValues = true,
32
         showAtFileInUsageHelp = true,
33
         descriptionHeading = "%nDescription:%n%n",
34
         parameterListHeading = "%nParameters:%n",
35
         optionListHeading = "%nOptions:%n",
36
         description = "Runs an active automata learning process by invoking the provided SUL(s) to answer membership queries. For learning acceptor-based formalisms, the tool will use the exitcode of the binary to determine acceptance where an exitcode of 0 equals 'accept' and an exitcode unequal to 0 equals 'reject'. For learning transduction-based formalisms, the tool expects the SUL to emit an output that is transformed into individual symbols using the provided 'delimiter'. For additional information on the involved components of LearnLib, you may use the documentation available at https://learnlib.de/learnlib/maven-site/.")
37
public class Application implements Runnable {
1✔
38

39
    public static final String PROPERTIES = "application";
40

41
    @Mixin
42
    private Options options;
43

44
    public static void main(String[] args) {
NEW
45
        CommandLine commandLine = new CommandLine(new Application());
×
NEW
46
        commandLine.setCaseInsensitiveEnumValuesAllowed(true);
×
NEW
47
        System.exit(commandLine.execute(args));
×
NEW
48
    }
×
49

50
    @Override
51
    public void run() {
52
        setLogLevel(options);
1✔
53
        options.type.runner(options).run(options);
1✔
54
    }
1✔
55

56
    private void setLogLevel(Options options) {
57
        if (options.verbosity != null) {
1✔
58
            final Logger root = (Logger) LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
1✔
59

60
            Level level;
61
            if (options.verbosity.length == 1) {
1✔
62
                level = Level.DEBUG;
1✔
63
            } else {
64
                level = Level.TRACE;
1✔
65
            }
66

67
            root.setLevel(level);
1✔
68
        }
69
    }
1✔
70
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc