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

hazendaz / smartsprites / 555

21 May 2026 03:26PM UTC coverage: 87.799%. Remained the same
555

push

github

hazendaz
[tests] Fix tests that were looking at size of original license before spdx change

557 of 670 branches covered (83.13%)

Branch coverage included in aggregate %.

1350 of 1502 relevant lines covered (89.88%)

0.9 hits per line

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

75.0
/src/main/java/org/carrot2/labs/smartsprites/SmartSprites.java
1
/*
2
 * SPDX-License-Identifier: BSD-3-Clause
3
 * See LICENSE file for details.
4
 *
5
 * Copyright 2021-2026 Hazendaz
6
 * Copyright (C) 2007-2009, Stanisław Osiński.
7
 */
8
package org.carrot2.labs.smartsprites;
9

10
import java.io.IOException;
11

12
import org.carrot2.labs.smartsprites.message.MessageLog;
13
import org.carrot2.labs.smartsprites.message.PrintStreamMessageSink;
14
import org.kohsuke.args4j.CmdLineException;
15
import org.kohsuke.args4j.CmdLineParser;
16
import org.kohsuke.args4j.ParserProperties;
17

18
/**
19
 * The entry class for SmartSprites.
20
 */
21
public class SmartSprites {
×
22

23
    /**
24
     * Entry point to SmartSprites. All parameters are passed as JVM properties.
25
     *
26
     * @param args
27
     *            the arguments
28
     *
29
     * @throws IOException
30
     *             Signals that an I/O exception has occurred.
31
     */
32
    public static void main(String[] args) throws IOException {
33
        final SmartSpritesParameters parameters = new SmartSpritesParameters();
1✔
34

35
        final ParserProperties parserProperties = ParserProperties.defaults();
1✔
36
        parserProperties.withUsageWidth(80);
1✔
37

38
        final CmdLineParser parser = new CmdLineParser(parameters, parserProperties);
1✔
39

40
        if (args.length == 0) {
1✔
41
            printUsage(parser);
1✔
42
            return;
1✔
43
        }
44

45
        try {
46
            parser.parseArgument(args);
×
47
        } catch (CmdLineException e) {
1✔
48
            printUsage(parser);
1✔
49
            System.out.println("\n" + e.getMessage());
1✔
50
            return;
1✔
51
        }
×
52

53
        // Get parameters form system properties
54
        final MessageLog messageLog = new MessageLog(new PrintStreamMessageSink(System.out, parameters.getLogLevel()));
×
55
        new SpriteBuilder(parameters, messageLog).buildSprites();
×
56
    }
×
57

58
    /**
59
     * Prints the usage.
60
     *
61
     * @param parser
62
     *            the parser
63
     */
64
    private static void printUsage(final CmdLineParser parser) {
65
        System.out.print("Usage: smartsprites");
1✔
66
        parser.printSingleLineUsage(System.out);
1✔
67
        System.out.println();
1✔
68
        System.out.println(
1✔
69
                "\nPlease see https://www.w3schools.com/css/css_image_sprites.asp for detailed option descriptions.");
70
    }
1✔
71
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc