Skip to content

Commit

Permalink
feat (cli): Log initial greeting message with version
Browse files Browse the repository at this point in the history
  • Loading branch information
vorburger committed Jun 27, 2024
1 parent 22bec71 commit 541c507
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
4 changes: 4 additions & 0 deletions java/dev/enola/cli/EnolaCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ public class EnolaCLI {
boolean[] verbosity = {};

static CLI cli(String... args) {
// TODO This runs "too early" (before parameter parsing and logging initialization of it)...
// see https://stackoverflow.com/q/78679524/421602
Lifecycle.start();

var enola = new EnolaCLI();
return new CLI(
args,
Expand Down
38 changes: 38 additions & 0 deletions java/dev/enola/cli/Lifecycle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2024 The Enola <https://enola.dev> Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package dev.enola.cli;

import dev.enola.common.Version;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

final class Lifecycle {

private static final Logger LOG = LoggerFactory.getLogger(Lifecycle.class);

static void start() {
LOG.info(
"Hi! \uD83D\uDC4B I'm https://Enola.dev v{}. "
+ "\uD83D\uDC7D \uD83D\uDC7E Resistance is futile. We are ONE. "
+ "What's your goal, today?\n",
Version.get());
}

private Lifecycle() {}
}

0 comments on commit 541c507

Please sign in to comment.